-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action to update spackages
This adds a manual and scheduled action to check for changes in ports-of-call and spiner spackages and migrate them over to singularity-eos. If a change is detected, it will create a PR authored by a bot.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Check Spack dependencies for updates | ||
|
||
on: | ||
# for manual jobs | ||
workflow_dispatch: | ||
# triggers at around 15:00 UTC (with some delay) | ||
schedule: | ||
- cron: '0 15 * * *' | ||
|
||
jobs: | ||
deps: | ||
name: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: create build | ||
run: mkdir build | ||
- name: Checkout ports-of-call | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: lanl/ports-of-call | ||
path: build/ports-of-call | ||
fetch-depth: 0 | ||
- name: Checkout spiner | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: lanl/spiner | ||
path: build/spiner | ||
fetch-depth: 0 | ||
- name: copy over spack-repo/packages | ||
run: | | ||
# assume ports-of-call may be newer than spiner | ||
cp -R build/spiner/spack-repo/packages/* spack-repo/packages/ | ||
cp -R build/ports-of-call/spack-repo/packages/* spack-repo/packages/ | ||
- name: is there a difference? | ||
run: git diff --exit-code --compact-summary | ||
id: no_change | ||
- name: create branch | ||
if: ${{ steps.no_change.conclusion == 'failure' }} | ||
run: | | ||
git config user.name 'github-actions[bot]' | ||
git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
git branch -D github-bot/update_spackages || true | ||
git checkout -b github-bot/update_spackages | ||
git add spack-repo | ||
git commit -m "spack updates" | ||
git push -f --set-upstream origin github-bot/update_spackages | ||
- name: create pull request | ||
if: ${{ steps.no_change.conclusion == 'failure' }} | ||
run: gh pr create -B main -H github-bot/update_spackages --title 'Update spackages' --body 'Created by Github action' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |