-
Notifications
You must be signed in to change notification settings - Fork 2
162 lines (144 loc) · 5.33 KB
/
Copy pathbinary_tarballs.yml
File metadata and controls
162 lines (144 loc) · 5.33 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# Upload and test GEMC binary tarballs.
name: Binary Tarballs
run-name: Triggered by successful deploy workflow
permissions:
actions: read
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
concurrency:
group: gemc-binary-tarballs-${{ github.event.workflow_run.id }}
cancel-in-progress: true
on:
workflow_run:
workflows: [ "Deploy" ]
types: [ completed ]
jobs:
release-tarballs:
if: >-
${{
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_repository.full_name == github.repository
}}
name: Attach GEMC tarballs to dev release
runs-on: ubuntu-latest
env:
TAG_NAME: dev
steps:
- name: Download GEMC tarballs from deploy run
uses: actions/download-artifact@v7
with:
pattern: gemc-tarball-*
path: ${{ runner.temp }}/gemc-release-artifacts
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
run-id: ${{ github.event.workflow_run.id }}
- name: Upload GEMC tarballs to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
shell: bash
run: |
shopt -s nullglob
tarballs=("${{ runner.temp }}/gemc-release-artifacts/"*.tar.gz)
shopt -u nullglob
if (( ${#tarballs[@]} == 0 )); then
echo "No GEMC tarballs found"
exit 1
fi
gh release view "${TAG_NAME}" --repo "$REPO" >/dev/null 2>&1 || \
gh release create "${TAG_NAME}" \
--repo "$REPO" \
--title "Dev Nightly" \
--prerelease \
--notes "Dev nightly release."
gh release upload "${TAG_NAME}" --repo "$REPO" "${tarballs[@]}" --clobber
discover:
if: >-
${{
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_repository.full_name == github.repository
}}
name: Create Job Matrix
runs-on: ubuntu-latest
outputs:
matrix_build: ${{ steps.scan.outputs.matrix_build }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: ${{ github.event.workflow_run.head_sha }}
- id: scan
name: Build matrix
run: ./ci/distros_tags.sh
test-tarball:
if: ${{ always() && needs.discover.result == 'success' && needs.release-tarballs.result == 'success' }}
name: ${{ matrix.image }}:${{ matrix.image_tag }} ${{ matrix.arch }}
needs: [ discover, release-tarballs ]
runs-on: ${{ matrix.runner }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.discover.outputs.matrix_build) }}
env:
TEST_IMAGE: gemc-binary-test:${{ matrix.image }}-${{ matrix.image_tag }}-${{ matrix.arch }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Generate minimal package Dockerfile
shell: bash
run: |
python3 - "${{ matrix.image }}" "${{ matrix.image_tag }}" > Dockerfile.gemc-binary-test <<'PY'
import sys
sys.path.insert(0, "ci")
from binary_packages import map_family, packages_install_command
image = sys.argv[1]
tag = sys.argv[2]
family = map_family(image)
print(f"FROM {image}:{tag}")
print('SHELL ["/bin/bash", "-c"]')
# Repo/bootstrap steps needed for package installation only. This
# deliberately skips g4install's Geant4/CLHEP/Xerces/noVNC builds.
if family == "archlinux":
print("RUN pacman-key --init && pacman-key --populate")
print("RUN pacman -Sy --noconfirm archlinux-keyring")
elif image == "almalinux":
print("RUN dnf install -y 'dnf-command(config-manager)' \\")
print(" && dnf config-manager --set-enabled crb")
print(packages_install_command(image, tag))
PY
cat Dockerfile.gemc-binary-test
- name: Build minimal package image
shell: bash
run: |
docker build \
--pull \
--platform "${{ matrix.platform }}" \
-f Dockerfile.gemc-binary-test \
-t "${TEST_IMAGE}" \
.
- name: Test GEMC binary tarball installation
shell: bash
run: |
archive="gemc-${{ matrix.gemc_tag }}-geant4-${{ matrix.geant4_tag }}"
archive="${archive}-${{ matrix.image }}-${{ matrix.image_tag }}-${{ matrix.arch }}.tar.gz"
url="https://github.com/gemc/src/releases/download/${{ matrix.gemc_tag }}/${archive}"
docker run --rm \
--platform "${{ matrix.platform }}" \
-e GEMC_TARBALL_URL="${url}" \
-e GEMC_TARBALL_ARCHIVE="${archive}" \
"${TEST_IMAGE}" \
bash -lc '
set -euo pipefail
gemc_home=/root/gemc
mkdir -p "$gemc_home"
cd "$gemc_home"
curl -L -o "$GEMC_TARBALL_ARCHIVE" "$GEMC_TARBALL_URL"
tar -xzf "$GEMC_TARBALL_ARCHIVE" -C "$gemc_home" --strip-components=1
./install_geant4_data.sh
source /root/gemc/gemc.env
gemc -v
test_gdynamic_plugin_load
test_gdata_event_verbose
'