-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new workflow for concretization and delete older concretization…
… workflows (#646)
- Loading branch information
Showing
3 changed files
with
69 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
concretize: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.image }}-${{ matrix.build_type }} | ||
cancel-in-progress: true | ||
strategy: | ||
matrix: | ||
image: [alma9, ubuntu22] | ||
build_type: [release, nightly] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Start container | ||
run: | | ||
name=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]') | ||
if [ "${{ matrix.image }}" = "alma9" ]; then | ||
docker run --name container --privileged -v ${GITHUB_WORKSPACE}:/key4hep-spack -v ~/.cache/ccache:/root/.cache/ccache -d ghcr.io/key4hep/key4hep-images/alma9-cvmfs tail -f /dev/null | ||
elif [ "${{ matrix.image }}" = "ubuntu22" ]; then | ||
docker run --name container --privileged -v ${GITHUB_WORKSPACE}:/key4hep-spack -v ~/.cache/ccache:/root/.cache/ccache -d ghcr.io/key4hep/key4hep-images/ubuntu22-cvmfs tail -f /dev/null | ||
else | ||
echo "Unknown image" | ||
exit 1 | ||
fi | ||
- name: Setup environment and concretize | ||
run: | | ||
cat <<'EOF' > ${GITHUB_WORKSPACE}/script_container.sh | ||
set -e | ||
cd / | ||
ls -lah / | ||
ls -lah /key4hep-spack | ||
git clone https://github.com/spack/spack -q | ||
source spack/share/spack/setup-env.sh | ||
cd /spack | ||
git checkout $(cat /key4hep-spack/.latest-commit) | ||
source /key4hep-spack/.cherry-pick | ||
if [ "${{ matrix.build_type }}" = "release" ]; then | ||
env=key4hep-release | ||
elif [ "${{ matrix.build_type }}" = "nightly" ]; then | ||
env=key4hep-nightly-opt | ||
pip3 install pyyaml | ||
python3 /key4hep-spack/scripts/fetch_nightly_versions.py --path /key4hep-spack/environments/key4hep-common/packages.yaml --extra-path /key4hep-spack/environments/key4hep-nightly-opt/packages.yaml "" | ||
else | ||
echo "Unknown build type" | ||
exit 1 | ||
fi | ||
cd /key4hep-spack/environments/${env} | ||
spack env activate . | ||
spack concretize | ||
EOF | ||
chmod +x ${GITHUB_WORKSPACE}/script_container.sh | ||
# cat ${GITHUB_WORKSPACE}/script_container.sh | ||
docker exec container /bin/bash -c "/mount.sh && /key4hep-spack/script_container.sh" |