Skip to content

Commit 9a8723e

Browse files
authored
Fix: [AEA-0000] - use new common workflows (#482)
## Summary - Routine Change ### Details - use new common workflows
1 parent b7d7703 commit 9a8723e

File tree

7 files changed

+104
-230
lines changed

7 files changed

+104
-230
lines changed

.github/config/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TAG_FORMAT: "v${version}"

.github/workflows/auto-merge-dependabot.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/pr-link.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,41 @@ env:
88
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
99

1010
jobs:
11+
dependabot-auto-approve-and-merge:
12+
needs: quality_checks
13+
uses: NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@ba86b0c6a2a3d4b87398e538e410cec90f57133d
14+
secrets:
15+
AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
16+
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
17+
get_asdf_version:
18+
runs-on: ubuntu-22.04
19+
outputs:
20+
asdf_version: ${{ steps.asdf-version.outputs.version }}
21+
tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }}
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
25+
26+
- name: Get asdf version
27+
id: asdf-version
28+
run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
29+
- name: Load config value
30+
id: load-config
31+
run: |
32+
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
33+
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
34+
1135
quality_checks:
12-
uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/[email protected]
36+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks.yml@ba86b0c6a2a3d4b87398e538e410cec90f57133d
37+
needs: [get_asdf_version]
38+
with:
39+
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
40+
reinstall_poetry: true
1341
secrets:
1442
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1543

1644
pr_title_format_check:
17-
uses: NHSDigital/eps-workflow-semantic-release/.github/workflows/pr_title_check.yml@b49130ecbac4f0a052642f6417a0ea0555240fd7
45+
uses: NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@ba86b0c6a2a3d4b87398e538e410cec90f57133d
1846

1947
run_basic_regression_test:
2048
uses: ./.github/workflows/regression_tests.yml
@@ -23,3 +51,13 @@ jobs:
2351
environment: INTERNAL-DEV
2452
product: EPS-FHIR
2553
id: "Pull Request Basic Regression Tests"
54+
tag_release:
55+
needs: [get_asdf_version]
56+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release.yml@8243c6b1e493c00f2285339039ab8748b4212a64
57+
with:
58+
dry_run: true
59+
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
60+
branch_name: ${{ github.event.pull_request.head.ref }}
61+
publish_package: false
62+
tag_format: ${{ needs.get_asdf_version.outputs.tag_format }}
63+
secrets: inherit

.github/workflows/regression_tests.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,18 @@ jobs:
143143
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
144144
with:
145145
ref: ${{ inputs.github_tag }}
146+
- name: Get asdf version
147+
id: asdf-version
148+
run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
146149

147150
# using git commit sha for version of action to ensure we have stable version
148151
- name: Install asdf
149152
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
150153
with:
151-
asdf_version: 0.16.4
154+
asdf_version: ${{ steps.asdf-version.outputs.version }}
152155

153156
- name: Cache asdf
154-
uses: actions/cache@v4
157+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
155158
with:
156159
path: |
157160
~/.asdf
@@ -160,7 +163,7 @@ jobs:
160163
- name: Install asdf dependencies in .tool-versions
161164
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
162165
with:
163-
asdf_version: 0.16.4
166+
asdf_version: ${{ steps.asdf-version.outputs.version }}
164167
env:
165168
PYTHON_CONFIGURE_OPTS: --enable-shared
166169

@@ -274,7 +277,7 @@ jobs:
274277
poetry run python ./runner.py --env="$ENVIRONMENT" --product="$PRODUCT" --tags="$TAGS"
275278
276279
- name: Upload Artifact
277-
uses: actions/upload-artifact@v4
280+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
278281
with:
279282
name: allure-results-${{ matrix.tag }}
280283
path: allure-results
@@ -291,9 +294,11 @@ jobs:
291294
if: always()
292295
steps:
293296
- name: Download matrix artifacts
294-
uses: actions/download-artifact@v5
297+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
295298
with:
296299
path: downloaded_artifacts
300+
pattern: allure-results-*
301+
merge-multiple: true
297302

298303
- name: Place matrix artifacts in allure results
299304
run: |
@@ -302,7 +307,7 @@ jobs:
302307
rsync -av downloaded_artifacts/environment.properties allure-results/
303308
304309
- name: Upload Artifact
305-
uses: actions/upload-artifact@v4
310+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
306311
with:
307312
name: allure-results
308313
path: allure-results
@@ -312,14 +317,18 @@ jobs:
312317
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
313318
with:
314319
ref: ${{ inputs.github_tag }}
320+
- name: Get asdf version
321+
id: asdf-version
322+
run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
323+
315324
# using git commit sha for version of action to ensure we have stable version
316325
- name: Install asdf
317326
uses: asdf-vm/actions/setup@9cd779f40fe38688dd19505ccbc4eaaf018b44e7
318327
with:
319-
asdf_version: 0.16.4
328+
asdf_version: ${{ steps.asdf-version.outputs.version }}
320329

321330
- name: Cache asdf
322-
uses: actions/cache@v4
331+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
323332
with:
324333
path: |
325334
~/.asdf
@@ -333,7 +342,7 @@ jobs:
333342
PYTHON_CONFIGURE_OPTS: --enable-shared
334343

335344
- name: Cache Virtualenv
336-
uses: actions/cache@v4
345+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830
337346
id: cache-venv
338347
with:
339348
path: .venv
@@ -344,14 +353,14 @@ jobs:
344353
run: |
345354
make install
346355
- name: download
347-
uses: actions/download-artifact@v5
356+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53
348357
with:
349358
name: allure-results
350359
path: allure-results
351360

352361
- name: Generate a token
353362
id: generate-token
354-
uses: actions/create-github-app-token@v2
363+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42
355364
if: contains(needs.*.result, 'failure') || github.event.inputs.generate_report == 'true'
356365
with:
357366
app-id: ${{ vars.REGRESSION_TESTS_APP_ID }}

0 commit comments

Comments
 (0)