Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed Nov 2, 2023
1 parent 5e6ba14 commit 61125be
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 35 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ jobs:
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Install Spack
run: |
git clone --depth=1 https://github.com/spack/spack.git
echo "$PWD/spack/bin/" >> "$GITHUB_PATH"
- name: Install Spack
run: |
git clone --depth=1 https://github.com/spack/spack.git
echo "$PWD/spack/bin/" >> "$GITHUB_PATH"
- name: Concretize
run: spack -e . concretize
- name: Concretize
run: spack -e . concretize

- name: Install
run: spack -e . install -j $(($(nproc) + 1)) --no-check-signature --fail-fast
- name: Install
run: spack -e . install -j $(($(nproc) + 1)) --no-check-signature --fail-fast

- name: Push packages and update index
run: |
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()
- name: Push packages and update index
run: |
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()
36 changes: 16 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,26 @@ on: push

env:
SPACK_COLOR: always
SPACK_BACKTRACE: please

jobs:
example:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Install Spack
run: |
git clone --depth=1 https://github.com/spack/spack.git
echo "$PWD/spack/bin/" >> "$GITHUB_PATH"
- name: Install Spack
run: |
git clone --depth=1 https://github.com/spack/spack.git
echo "$PWD/spack/bin/" >> "$GITHUB_PATH"
- name: Concretize
run: spack -e . concretize
- name: Concretize
run: spack -e . concretize

- name: Install
run: spack -e . install --no-check-signature
- name: Install
run: spack -e . install --no-check-signature

- name: Run
- name: Run
run: ./my_view/bin/python -c 'print("hello world")'
```
Expand All @@ -75,7 +74,6 @@ If you want to cache your own binaries too, there are three steps to take:
runs-on: ubuntu-22.04
permissions:
packages: write
steps: ...
```

3. Add an extra job step that pushes installed Spack packages to the local
Expand All @@ -84,14 +82,12 @@ If you want to cache your own binaries too, there are three steps to take:
```yaml
jobs:
example:
...
steps:
...
- name: Push packages and update index
run: |
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()
- name: Push packages and update index
run: |
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()
```
NOTE: Make sure to add `if: always()`, so that binaries for successfully
installed packages are available also when a dependent fails to build.
Expand Down

0 comments on commit 61125be

Please sign in to comment.