Skip to content

Commit

Permalink
Add concurrency key for push
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed Nov 2, 2023
1 parent 78b696d commit 6d8f2a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ jobs:
spack -e . mirror set --push --oci-username haampie --oci-password "${{ secrets.GITHUB_TOKEN }}" spack-buildcache
spack -e . buildcache push -j $(($(nproc) + 1)) --base-image ubuntu:22.04 --unsigned --update-index spack-buildcache
if: always()
concurrency: create_buildcache
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ If you want to cache your own binaries too, there are three steps to take:
```

3. Add an extra job step that pushes installed Spack packages to the local
buildcache. Make sure to add `if: always()`, so that binaries for
successfully installed packages are available also when a dependent fails to
build:
buildcache:

```yaml
jobs:
Expand All @@ -94,4 +92,11 @@ If you want to cache your own binaries too, there are three steps to take:
spack -e . mirror set --push --oci-username <username> --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
spack -e . buildcache push --base-image ubuntu:22.04 --unsigned --update-index local-buildcache
if: always()
concurrency: create_buildcache
```
NOTE: Make sure to add `if: always()`, so that binaries for successfully
installed packages are available also when a dependent fails to build.

NOTE: Updating the buildcache index is not race free, so use `concurrency`
to ensure that no two Github Actions push to the buildcache concurrently.

0 comments on commit 6d8f2a9

Please sign in to comment.