Skip to content

Commit e0aa4e4

Browse files
committed
testing new test deploy and binary workflow
1 parent 5cc9897 commit e0aa4e4

7 files changed

Lines changed: 231 additions & 69 deletions

File tree

.github/workflows/binary_tarballs.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ env:
99
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1010

1111
concurrency:
12-
group: gemc-binary-tarballs-${{ github.event.workflow_run.id || github.ref }}
12+
group: gemc-binary-tarballs-${{ github.event.workflow_run.id }}
1313
cancel-in-progress: true
1414

1515
on:
1616
workflow_run:
17-
workflows: [ "Deploy and Test" ]
17+
workflows: [ "Deploy" ]
1818
types: [ completed ]
19-
workflow_dispatch:
2019

2120
jobs:
2221
release-tarballs:
23-
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request' }}
22+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2423
name: Attach GEMC tarballs to dev release
2524
runs-on: ubuntu-latest
2625
env:
@@ -50,24 +49,30 @@ jobs:
5049
exit 1
5150
fi
5251
gh release view "${TAG_NAME}" --repo "$REPO" >/dev/null 2>&1 || \
53-
gh release create "${TAG_NAME}" --repo "$REPO" --title "Dev Nightly" --prerelease --notes "Dev nightly release."
52+
gh release create "${TAG_NAME}" \
53+
--repo "$REPO" \
54+
--title "Dev Nightly" \
55+
--prerelease \
56+
--notes "Dev nightly release."
5457
gh release upload "${TAG_NAME}" --repo "$REPO" "${tarballs[@]}" --clobber
5558
5659
discover:
57-
if: ${{ github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request') }}
60+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
5861
name: Create Job Matrix
5962
runs-on: ubuntu-latest
6063
outputs:
6164
matrix_build: ${{ steps.scan.outputs.matrix_build }}
6265
steps:
6366
- name: Checkout repository
6467
uses: actions/checkout@v6
68+
with:
69+
ref: ${{ github.event.workflow_run.head_sha }}
6570
- id: scan
6671
name: Build matrix
6772
run: ./ci/distros_tags.sh
6873

6974
test-tarball:
70-
if: ${{ always() && needs.discover.result == 'success' && (github.event_name != 'workflow_run' || needs.release-tarballs.result == 'success') }}
75+
if: ${{ always() && needs.discover.result == 'success' && needs.release-tarballs.result == 'success' }}
7176
name: ${{ matrix.image }}:${{ matrix.image_tag }} ${{ matrix.arch }}
7277
needs: [ discover, release-tarballs ]
7378
runs-on: ${{ matrix.runner }}
@@ -122,7 +127,8 @@ jobs:
122127
- name: Test GEMC binary tarball installation
123128
shell: bash
124129
run: |
125-
archive="gemc-${{ matrix.gemc_tag }}-geant4-${{ matrix.geant4_tag }}-${{ matrix.image }}-${{ matrix.image_tag }}-${{ matrix.arch }}.tar.gz"
130+
archive="gemc-${{ matrix.gemc_tag }}-geant4-${{ matrix.geant4_tag }}"
131+
archive="${archive}-${{ matrix.image }}-${{ matrix.image_tag }}-${{ matrix.arch }}.tar.gz"
126132
url="https://github.com/gemc/src/releases/download/${{ matrix.gemc_tag }}/${archive}"
127133
128134
docker run --rm \

.github/workflows/codeql.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,11 @@ on:
77
push:
88
branches: [ "main" ]
99
paths-ignore:
10-
- "**/README*"
11-
- "**/LICENSE*"
12-
- "**/CODE_OF_CONDUCT.md"
13-
- "**/CONTRIBUTING.md"
14-
- "**/SECURITY.md"
10+
- "**/*.md"
1511
pull_request:
1612
branches: [ "main" ]
1713
paths-ignore:
18-
- "**/README*"
19-
- "**/LICENSE*"
20-
- "**/CODE_OF_CONDUCT.md"
21-
- "**/CONTRIBUTING.md"
22-
- "**/SECURITY.md"
14+
- "**/*.md"
2315
schedule:
2416
- cron: '20 2 * * 5'
2517

.github/workflows/dockers_deploy_and_test.yml

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Build & Publish GitHub Container Registry (GHCR) Images
2-
name: Deploy and Test
1+
# Build and publish GitHub Container Registry (GHCR) images after tests pass.
2+
name: Deploy
33
permissions:
44
contents: write
55
packages: write
@@ -11,41 +11,28 @@ env:
1111
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1212

1313
concurrency:
14-
group: gemc-images-${{ github.ref }}
14+
group: gemc-deploy-${{ github.event.workflow_run.id }}
1515
cancel-in-progress: true
1616

1717
on:
18-
# Allows this workflow to be triggered from other repositories (e.g. pygemc)
19-
workflow_dispatch:
20-
21-
pull_request:
22-
paths-ignore:
23-
- "**/README*"
24-
- "**/LICENSE*"
25-
- "**/CODE_OF_CONDUCT.md"
26-
- "**/CONTRIBUTING.md"
27-
- "**/SECURITY.md"
28-
merge_group:
29-
push:
30-
branches: [ main ]
31-
tags: [ '*' ]
32-
paths-ignore:
33-
- "**/*.md"
34-
- "**/README*"
35-
- "**/CODE_OF_CONDUCT.md"
36-
- "**/CONTRIBUTING.md"
37-
- "**/SECURITY.md"
38-
- "releases/**"
39-
- "doc/**"
18+
workflow_run:
19+
workflows: [ "Test" ]
20+
types: [ completed ]
4021

4122
jobs:
4223
overview:
43-
if: ${{ github.event_name != 'pull_request' }}
24+
if: >-
25+
${{
26+
github.event.workflow_run.conclusion == 'success' &&
27+
github.event.workflow_run.event == 'push'
28+
}}
4429
name: Workflow Overview
4530
runs-on: ubuntu-latest
4631
steps:
4732
- name: Checkout repository
4833
uses: actions/checkout@v6
34+
with:
35+
ref: ${{ github.event.workflow_run.head_sha }}
4936

5037
- name: Write overview
5138
shell: bash
@@ -54,7 +41,11 @@ jobs:
5441
bash ci/summary.sh "$GITHUB_STEP_SUMMARY"
5542
5643
discover:
57-
if: ${{ github.event_name != 'pull_request' }}
44+
if: >-
45+
${{
46+
github.event.workflow_run.conclusion == 'success' &&
47+
github.event.workflow_run.event == 'push'
48+
}}
5849
name: Create Job Matrices
5950
runs-on: ubuntu-latest
6051
outputs:
@@ -64,14 +55,15 @@ jobs:
6455
steps:
6556
- name: Checkout repository
6657
uses: actions/checkout@v6
58+
with:
59+
ref: ${{ github.event.workflow_run.head_sha }}
6760
- id: scan
6861
name: Build matrix
6962
run: ci/distros_tags.sh
7063

7164
# arch build jobs
7265
# uses matrix_build
7366
build_arch:
74-
if: ${{ github.event_name != 'pull_request' }}
7567
name: ${{ matrix.image }}/${{ matrix.image_tag }} ${{ matrix.arch }}
7668
needs: [ overview, discover ]
7769
runs-on: ${{ matrix.runner }}
@@ -88,6 +80,9 @@ jobs:
8880
steps:
8981
- name: Checkout repository
9082
uses: actions/checkout@v6
83+
with:
84+
ref: ${{ github.event.workflow_run.head_sha }}
85+
fetch-depth: 0
9186

9287
- name: Free up disk space
9388
uses: ./.github/actions/free-disk-space
@@ -114,7 +109,7 @@ jobs:
114109
type=raw,value=${{ env.TAG4 }}
115110
labels: |
116111
org.opencontainers.image.source=${{ github.repository }}
117-
org.opencontainers.image.description=GEMC ${{ matrix.gemc_tag }} on ${{ matrix.image }}:${{ matrix.image_tag }} (${{ matrix.arch }})
112+
org.opencontainers.image.description=GEMC ${{ matrix.gemc_tag }} ${{ matrix.arch }}
118113
119114
- name: Generate Dockerfile
120115
run: |
@@ -124,23 +119,18 @@ jobs:
124119
--gemc-version "${{ matrix.gemc_tag || env.GEMC_TAG }}" \
125120
--geant4-version "${{ matrix.geant4_tag || env.GEANT4_TAG }}" \
126121
--with-package \
122+
--source context \
127123
--package-arch "${{ matrix.arch }}" \
128124
> Dockerfile.generated
129125
cat Dockerfile.generated
130126
131-
# later pass it in the step below so that it's executed for every commit
132-
- name: Get upstream commit
133-
run: echo "UPSTREAM_REV=$(git ls-remote https://github.com/gemc/src HEAD | cut -f1)" >> $GITHUB_ENV
134-
135127
- name: Build & Push
136128
uses: docker/build-push-action@v7
137129
with:
138130
# ensure we have the latest base image
139131
pull: true
140132
# force a full rebuild regardless of any local cache from previous workflow runs
141133
no-cache: true
142-
build-args: |
143-
UPSTREAM_REV=${{ env.UPSTREAM_REV }}
144134
context: .
145135
file: ./Dockerfile.generated
146136
target: final
@@ -205,7 +195,6 @@ jobs:
205195
# docker buildx imagetools create: assembles an OCI manifest list
206196
# from already-pushed per-arch image tags.
207197
manifest:
208-
if: ${{ github.event_name != 'pull_request' }}
209198
name: ${{ matrix.image }}/${{ matrix.image_tag }}
210199
needs: [ build_arch, discover ]
211200
runs-on: ubuntu-latest
@@ -218,6 +207,8 @@ jobs:
218207
steps:
219208
- name: Checkout repository
220209
uses: actions/checkout@v6
210+
with:
211+
ref: ${{ github.event.workflow_run.head_sha }}
221212

222213
- name: Log in to GHCR
223214
uses: docker/login-action@v4
@@ -281,3 +272,24 @@ jobs:
281272
name: summary-${{ env.TAG4 }}-manifest
282273
path: ${{ env.MANIFEST_SUMMARY_FILE }}
283274
if-no-files-found: warn
275+
276+
final:
277+
name: Deploy - summary
278+
if: >-
279+
${{
280+
always() &&
281+
github.event.workflow_run.conclusion == 'success' &&
282+
github.event.workflow_run.event == 'push'
283+
}}
284+
needs: [ build_arch, manifest ]
285+
runs-on: ubuntu-latest
286+
steps:
287+
- name: Fail if any required job failed
288+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
289+
run: |
290+
echo "### Some GEMC deploy jobs failed or were cancelled." >> "$GITHUB_STEP_SUMMARY"
291+
exit 1
292+
293+
- name: Pass
294+
run: |
295+
echo "### GEMC deploy workflow passed." >> "$GITHUB_STEP_SUMMARY"

.github/workflows/doxygen.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ on:
1111
branches:
1212
- '*'
1313
paths-ignore:
14-
- "**/README*"
15-
- "**/LICENSE*"
16-
- "**/CODE_OF_CONDUCT.md"
17-
- "**/CONTRIBUTING.md"
18-
- "**/SECURITY.md"
14+
- "**/*.md"
1915
workflow_dispatch:
2016

2117
jobs:

.github/workflows/sanitize.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,10 @@ on:
1414
branches: [ main ]
1515
tags: [ 'v*' ]
1616
paths-ignore:
17-
- "**/README*"
18-
- "**/LICENSE*"
19-
- "**/CODE_OF_CONDUCT.md"
20-
- "**/CONTRIBUTING.md"
21-
- "**/SECURITY.md"
17+
- "**/*.md"
2218
pull_request:
2319
paths-ignore:
24-
- "**/README*"
25-
- "**/LICENSE*"
26-
- "**/CODE_OF_CONDUCT.md"
27-
- "**/CONTRIBUTING.md"
28-
- "**/SECURITY.md"
20+
- "**/*.md"
2921

3022
jobs:
3123
discover:

0 commit comments

Comments
 (0)