Skip to content

Commit

Permalink
compiler matrix expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Dec 13, 2024
1 parent 2ee2fcf commit 870174d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 11 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/build_spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ jobs:
fail-fast: false
matrix:
include:

- os: macos-14
xcode: "15.0.1"
compiler: "[email protected]"
publish: false

- os: macos-14
xcode: "16.0.0"
compiler: "[email protected]"
publish: true

- os: macos-15
xcode: "16.0.0"
compiler: "[email protected]"
publish: true

uses: ./.github/workflows/spack.yml
with:
os: ${{ matrix.os }}
Expand All @@ -31,9 +43,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
include:

- os: ubuntu-22.04
compiler: [email protected]
publish: true

- os: ubuntu-24.04
compiler: [email protected]
publish: true

- os: ubuntu-24.04
compiler: [email protected]
publish: false

uses: ./.github/workflows/spack.yml
with:
os: ${{ matrix.os }}
Expand All @@ -43,8 +66,12 @@ jobs:
strategy:
fail-fast: false
matrix:
image:
- ghcr.io/acts-project/alma9-base:67

include:
- image: ghcr.io/acts-project/alma9-base:67
compiler: [email protected]
publish: true

uses: ./.github/workflows/spack.yml
with:
os: ubuntu-latest
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ on:
required: false
type: string
default: "latest-stable"
compiler:
required: false
type: string
default: ""
publish:
required: false
type: boolean
default: true
default: false

jobs:

Expand All @@ -38,7 +42,8 @@ jobs:
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
curl https://patch-diff.githubusercontent.com/raw/spack/spack/pull/47370.patch | git am
- run: |
- name: List visible compilers
run: |
spack compiler find
spack compilers
Expand Down Expand Up @@ -74,6 +79,11 @@ jobs:
rm -rf /usr/share/dotnet/
df -h
- name: Select compiler
if: inputs.compiler != ''
run: |
spack -e .config add 'packages:all:compiler: ["%${{ inputs.compiler }}"]'
- name: Spack concretize
run: |
spack -e . concretize -Uf
Expand Down Expand Up @@ -102,28 +112,32 @@ jobs:
- name: Derive target triplet
run: |
echo "TARGET_TRIPLET=$(spack arch --family)" >> "$GITHUB_ENV"
if [ "${{ inputs.compiler }}" != "" ]; then
echo "TARGET_TRIPLET=$(spack arch --family)_${{ inputs.compiler }}" >> "$GITHUB_ENV"
else
echo "TARGET_TRIPLET=$(spack arch --family)" >> "$GITHUB_ENV"
fi
- name: Copy spack.lock to target-triplet
run: |
echo "TARGET_TRIPLET=${TARGET_TRIPLET}" >> "$GITHUB_ENV"
cp spack.lock "spack-${TARGET_TRIPLET}.lock"
cp spack.lock "spack_${TARGET_TRIPLET}.lock"
- name: Upload lock files
if: inputs.publish
uses: actions/upload-artifact@v4
with:
name: spack-${{ env.TARGET_TRIPLET }}-locks
path: |
spack-*.lock
spack_*.lock
if-no-files-found: error

- name: Add lock files to release
uses: softprops/action-gh-release@v2
if: inputs.publish && startsWith(github.ref, 'refs/tags/')
with:
files: |
spack-*.lock
spack_*.lock
- name: Push packages and update index
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) && !cancelled()
Expand Down

0 comments on commit 870174d

Please sign in to comment.