-
Notifications
You must be signed in to change notification settings - Fork 24
86 lines (72 loc) · 3.13 KB
/
concretize-current-nightly.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Concretize using the current nightlies as upstream to check if packages are changed or not
# with the new changes
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
concretize-current-nightly:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.image }}-${{ matrix.build_type }}
cancel-in-progress: true
strategy:
matrix:
image: [alma9, ubuntu22]
build_type: [nightly]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: GH_TOKEN
shell: bash
run: echo "GITHUB_TOKEN=${GH_TOKEN}" >> $GITHUB_ENV
- 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 /
if [ "${{ matrix.image }}" = "alma9" ]; then
os=almalinux9
elif [ "${{ matrix.image }}" = "ubuntu22" ]; then
os=ubuntu22
else
echo "Unknown image"
exit 1
fi
rel=$(find /cvmfs/sw-nightlies.hsf.org/key4hep/releases/ -maxdepth 3 -type f -wholename "*$os*opt*/.scratch" | sort -r | head -1)
rel=$(dirname $rel)
git clone https://github.com/spack/spack -q
cd /spack
git checkout $(cat /key4hep-spack/.latest-commit)
source /key4hep-spack/.cherry-pick
source /spack/share/spack/setup-env.sh
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 config add "upstreams:nightly-from-scratch:install_tree: $rel"
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"