Skip to content

Commit 1f099a5

Browse files
authored
ci(fix): race condition when building and testing installers (runfinch#1551)
Signed-off-by: Justin Alvarez <alvajus@amazon.com>
1 parent f7b25d3 commit 1f099a5

File tree

5 files changed

+57
-8
lines changed

5 files changed

+57
-8
lines changed

.github/workflows/build-and-test-deb.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
ref_name:
7+
description: "name of git ref for which to build installer"
78
required: true
89
type: string
910
workflow_call:
@@ -31,6 +32,7 @@ jobs:
3132
outputs:
3233
tag: ${{ steps.check-tag.outputs.tag }}
3334
version: ${{ steps.check-tag.outputs.version }}
35+
commit: ${{ steps.export-commit.outputs.commit }}
3436
steps:
3537
- name: Check tag from workflow input and github ref
3638
id: check-tag
@@ -50,6 +52,17 @@ jobs:
5052
version="0.0.1+${{ github.sha }}"
5153
fi
5254
echo "version=$version" >> ${GITHUB_OUTPUT}
55+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
56+
with:
57+
ref: ${{ steps.check-tag.outputs.tag }}
58+
fetch-depth: 0
59+
persist-credentials: false
60+
submodules: true
61+
- name: Export commit hash
62+
id: export-commit
63+
run: |
64+
commit=$(git rev-parse HEAD)
65+
echo "commit=$commit" >> ${GITHUB_OUTPUT}
5366
5467
ubuntu-deb-build-and-test:
5568
needs: get-tag-and-version
@@ -76,7 +89,7 @@ jobs:
7689
rm -rf ${{ github.workspace }}/*
7790
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7891
with:
79-
ref: ${{ inputs.tag }}
92+
ref: ${{ needs.get-tag-and-version.outputs.commit }}
8093
fetch-depth: 0
8194
persist-credentials: false
8295
submodules: true

.github/workflows/build-and-test-msi.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
workflow_dispatch:
66
inputs:
77
ref_name:
8+
description: "name of git ref for which to build installer"
89
required: true
910
type: string
1011
workflow_call:
@@ -32,6 +33,7 @@ jobs:
3233
outputs:
3334
tag: ${{ steps.check-tag.outputs.tag }}
3435
version: ${{ steps.check-tag.outputs.version }}
36+
commit: ${{ steps.export-commit.outputs.commit }}
3537
steps:
3638
- name: Check tag from workflow input and github ref
3739
id: check-tag
@@ -51,7 +53,18 @@ jobs:
5153
version="0.0.1"
5254
fi
5355
echo "version=$version" >> ${GITHUB_OUTPUT}
54-
56+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
57+
with:
58+
ref: ${{ steps.check-tag.outputs.tag }}
59+
fetch-depth: 0
60+
persist-credentials: false
61+
submodules: true
62+
- name: Export commit hash
63+
id: export-commit
64+
run: |
65+
commit=$(git rev-parse HEAD)
66+
echo "commit=$commit" >> ${GITHUB_OUTPUT}
67+
5568
windows-msi-build:
5669
needs: get-tag-name
5770
runs-on: [self-hosted, windows, amd64, release]
@@ -78,7 +91,7 @@ jobs:
7891
cache: false
7992
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8093
with:
81-
ref: ${{ needs.get-tag-name.outputs.tag }}
94+
ref: ${{ needs.get-tag-name.outputs.commit }}
8295
fetch-depth: 0
8396
persist-credentials: false
8497
submodules: recursive
@@ -162,8 +175,6 @@ jobs:
162175
needs:
163176
- get-tag-name
164177
- windows-msi-build
165-
strategy:
166-
fail-fast: false
167178
runs-on: [self-hosted, windows, amd64, release]
168179
timeout-minutes: 180
169180
steps:
@@ -188,7 +199,7 @@ jobs:
188199
cache: false
189200
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
190201
with:
191-
ref: ${{ needs.get-tag-name.outputs.tag }}
202+
ref: ${{ needs.get-tag-name.outputs.commit }}
192203
fetch-depth: 0
193204
persist-credentials: false
194205
submodules: recursive

.github/workflows/build-and-test-pkg.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
workflow_dispatch:
66
inputs:
77
ref_name:
8+
description: "name of git ref for which to build installer"
89
required: true
910
type: string
1011
workflow_call:
@@ -24,6 +25,7 @@ jobs:
2425
timeout-minutes: 2
2526
outputs:
2627
tag: ${{ steps.check-tag.outputs.tag }}
28+
commit: ${{ steps.export-commit.outputs.commit }}
2729
steps:
2830
- name: Check tag from workflow input and github ref
2931
id: check-tag
@@ -33,7 +35,20 @@ jobs:
3335
else
3436
tag=${{ github.ref_name }}
3537
fi
38+
echo "using tag=${tag}"
3639
echo "tag=$tag" >> ${GITHUB_OUTPUT}
40+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
41+
with:
42+
ref: ${{ steps.check-tag.outputs.tag }}
43+
fetch-depth: 0
44+
persist-credentials: false
45+
submodules: true
46+
- name: Export commit hash
47+
id: export-commit
48+
run: |
49+
commit=$(git rev-parse HEAD)
50+
echo "using commit=${commit}"
51+
echo "commit=$commit" >> ${GITHUB_OUTPUT}
3752
3853
macos-aarch64-pkg-build:
3954
needs: get-tag-name
@@ -45,6 +60,7 @@ jobs:
4560
output_arch: aarch64
4661
version: 14
4762
tag: ${{ needs.get-tag-name.outputs.tag }}
63+
commit: ${{ needs.get-tag-name.outputs.commit }}
4864

4965
macos-x86-64-pkg-build:
5066
needs: get-tag-name
@@ -56,6 +72,7 @@ jobs:
5672
output_arch: x86_64
5773
version: 14
5874
tag: ${{ needs.get-tag-name.outputs.tag }}
75+
commit: ${{ needs.get-tag-name.outputs.commit }}
5976

6077
macos-aarch64-pkg-test:
6178
strategy:
@@ -73,6 +90,7 @@ jobs:
7390
output_arch: aarch64
7491
version: ${{ matrix.version }}
7592
tag: ${{ needs.get-tag-name.outputs.tag }}
93+
commit: ${{ needs.get-tag-name.outputs.commit }}
7694

7795
macos-x86-64-pkg-test:
7896
strategy:
@@ -90,3 +108,4 @@ jobs:
90108
output_arch: x86_64
91109
version: ${{ matrix.version }}
92110
tag: ${{ needs.get-tag-name.outputs.tag }}
111+
commit: ${{ needs.get-tag-name.outputs.commit }}

.github/workflows/build-pkg.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
tag:
1818
type: string
1919
required: true
20+
commit:
21+
type: string
22+
required: true
2023

2124
permissions:
2225
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.
@@ -46,7 +49,7 @@ jobs:
4649
shell: zsh {0}
4750
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4851
with:
49-
ref: ${{ inputs.tag }}
52+
ref: ${{ inputs.commit }}
5053
fetch-depth: 0
5154
persist-credentials: false
5255
submodules: true

.github/workflows/test-pkg.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
tag:
1818
type: string
1919
required: true
20+
commit:
21+
type: string
22+
required: true
2023

2124
permissions:
2225
# This is required for configure-aws-credentials to request an OIDC JWT ID token to access AWS resources later on.
@@ -45,7 +48,7 @@ jobs:
4548
- name: Checkout the tag
4649
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4750
with:
48-
ref: ${{ inputs.tag }}
51+
ref: ${{ inputs.commit }}
4952
fetch-depth: 0
5053
persist-credentials: false
5154
submodules: true

0 commit comments

Comments
 (0)