diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f2f01a0..df7559e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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() diff --git a/README.md b/README.md index 05c47d6..c7cc6b6 100644 --- a/README.md +++ b/README.md @@ -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")' ``` @@ -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 @@ -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 --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 --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.