Skip to content

Commit

Permalink
try and use --unsigned in build cache
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed Dec 11, 2023
1 parent 2b527d0 commit dc6902b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,40 @@ jobs:
- releases/v0.21
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up Spack
uses: ./
with:
ref: ${{ matrix.ref }}
buildcache: true
color: true

- name: Version check
run: spack --version

- name: Check build cache config
run: spack config blame mirrors
- name: Check build cache install in active env with spack-bash shell

- name: Check build cache install in active env with spack-bash shell (new style)
shell: spack-bash {0}
run: |
spack env activate
spack install --add --cache-only --no-check-signature --reuse python
spack install --add --cache-only --reuse python
which python3
python3 -c 'print("hello world")'
if: matrix.ref == 'develop'

- name: Check build cache install in active env with spack-bash shell (old style)
shell: spack-bash {0}
run: |
spack env activate
spack install --add --cache-only --reuse --no-check-signature python
which python3
python3 -c 'print("hello world")'
if: matrix.ref == 'develop'

- name: Check spack-sh shell
shell: spack-sh {0}
run: |
spack env activate
spack env status
spack env status
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ jobs:
buildcache: true # Configure oci://ghcr.io/spack/github-actions-buildcache
color: true # Force color output (SPACK_COLOR=always)
path: spack # Where to clone Spack
- run: spack install --no-check-signature --reuse python
- run: spack install python
```
When `buildcache: true` is set, binaries from https://github.com/spack/github-actions-buildcache
are used. For available software, [see here](https://github.com/spack/github-actions-buildcache/blob/main/spack.yaml).

These binaries are unsigned, so you have to specify `install --no-check-signature`.
**Note**: when using the build cache with Spack v0.21 and below, the following flag is
required:

```
spack install --no-check-signature
```

This flag is no longer required in Spack v0.22.

## Example: shell support

Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ runs:
- name: Spack configuration
run: |
if [ ${{ inputs.buildcache }} = "true" ]; then
# Spack 0.22 should support the --unsigned flag
spack mirror add --unsigned github-actions-buildcache oci://ghcr.io/spack/github-actions-buildcache || \
spack mirror add github-actions-buildcache oci://ghcr.io/spack/github-actions-buildcache
fi
shell: sh
Expand Down

0 comments on commit dc6902b

Please sign in to comment.