Skip to content

npsim: new version 1.2.0 #880

npsim: new version 1.2.0

npsim: new version 1.2.0 #880

Workflow file for this run

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 }}