Skip to content

Commit

Permalink
Merge pull request #259 from lanl/rberger_gh_action_for_spackages
Browse files Browse the repository at this point in the history
Add GitHub action to update spackages 🤖
  • Loading branch information
jhp-lanl authored May 22, 2023
2 parents 6d91f5d + 02c71bd commit c59bb3a
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 4 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/deps.yml
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@v3
with:
fetch-depth: 0
- name: create build
run: mkdir build
- name: Checkout ports-of-call
uses: actions/checkout@v3
with:
repository: lanl/ports-of-call
path: build/ports-of-call
fetch-depth: 0
- name: Checkout spiner
uses: actions/checkout@v3
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set system to non-interactive mode
run: export DEBIAN_FRONTEND=noninteractive
- name: install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set system to non-interactive mode
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set system to non-interactive mode
Expand Down
5 changes: 5 additions & 0 deletions doc/sphinx/src/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ submit issues on the relevant github pages. However, if you can't
figure out where an issue belongs, no big deal. Submit where you can
and we'll engage with you to figure out how to proceed.

.. note::
There are scheduled workflows triggered by GitHub actions that will
automatically check ``spiner`` and ``ports-of-call`` for Spack updates. If
detected, the GitHub action bot will create a PR with the necessary changes.

Process for adding a new EOS
----------------------------

Expand Down

0 comments on commit c59bb3a

Please sign in to comment.