epic-eic: new versions 23.07.* #862
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Packages | |
on: [push, pull_request] | |
jobs: | |
generate-matrix: | |
name: Generate matrix for build | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
empty: ${{ steps.set-matrix.outputs.empty }} | |
steps: | |
- uses: actions/checkout@v2 | |
- id: set-matrix | |
run: | | |
CHANGED_PACKAGES=$(git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | sed 's|^packages/||' | xargs -I {} dirname {} | uniq) | |
EMPTY=true | |
JSON="{\"include\":[" | |
for pkg in farmhash ${CHANGED_PACKAGES} ; do | |
if [ ! -d packages/$pkg ] ; then continue ; fi | |
if [ ! -f packages/$pkg/package.py ] ; then continue ; fi | |
# Add build to the matrix only if it is not already included | |
JSONline="{\"pkg\": \"$pkg\"}," | |
if [[ "$JSON" != *"$JSONline"* ]]; then | |
JSON="$JSON$JSONline" | |
EMPTY=false | |
fi | |
done | |
# Remove last "," and add closing brackets | |
if [[ $JSON == *, ]]; then | |
JSON="${JSON%?}" | |
fi | |
JSON="$JSON]}" | |
echo $JSON | |
# Set output | |
echo "::set-output name=matrix::$( echo "$JSON" )" | |
echo "::set-output name=empty::$EMPTY" | |
build: | |
name: Build ${{ matrix.pkg }} | |
needs: generate-matrix | |
if: ${{ needs.generate-matrix.outputs.empty == 'false' }} | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}} | |
runs-on: ubuntu-latest | |
container: ghcr.io/spack/ubuntu-jammy:latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup eic-spack repository | |
run: | | |
. /opt/spack/share/spack/setup-env.sh | |
spack repo add $PWD | |
spack repo list | |
- name: Build package ${{ matrix.pkg }} | |
run: | | |
. /opt/spack/share/spack/setup-env.sh | |
spack install ${{ matrix.pkg }} |