Skip to content

Commit ac4218c

Browse files
committed
Make jobs run sequentially
1 parent 637eea1 commit ac4218c

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
outputs:
1414
cache-key: ${{ steps.cache-key.outputs.key }}
15+
go-cache-key: ${{ steps.go-cache-key.outputs.key }}
1516

1617
steps:
1718
- name: Checkout code
@@ -22,10 +23,14 @@ jobs:
2223
with:
2324
go-version: "1.23"
2425

25-
- name: Generate cache key
26+
- name: Generate cache keys
2627
id: cache-key
2728
run: echo "key=${{ runner.os }}-binaries-${{ hashFiles('**/go.sum', '**/*.go') }}" >> $GITHUB_OUTPUT
2829

30+
- name: Generate Go cache key
31+
id: go-cache-key
32+
run: echo "key=${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}" >> $GITHUB_OUTPUT
33+
2934
- name: Cache binaries
3035
id: cache-binaries
3136
uses: actions/cache@v3
@@ -36,13 +41,12 @@ jobs:
3641
key: ${{ steps.cache-key.outputs.key }}
3742

3843
- name: Cache Go modules
39-
if: steps.cache-binaries.outputs.cache-hit != 'true'
4044
uses: actions/cache@v3
4145
with:
4246
path: |
4347
~/.cache/go-build
4448
~/go/pkg/mod
45-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
49+
key: ${{ steps.go-cache-key.outputs.key }}
4650
restore-keys: |
4751
${{ runner.os }}-go-
4852
@@ -59,7 +63,7 @@ jobs:
5963
go build -o mpcium-cli ./cmd/mpcium-cli
6064
chmod +x mpcium mpcium-cli
6165
62-
# Key Generation E2E Tests
66+
# Key Generation E2E Tests (runs first)
6367
e2e-keygen:
6468
runs-on: ubuntu-latest
6569
needs: build
@@ -87,7 +91,7 @@ jobs:
8791
path: |
8892
~/.cache/go-build
8993
~/go/pkg/mod
90-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
94+
key: ${{ needs.build.outputs.go-cache-key }}
9195
restore-keys: |
9296
${{ runner.os }}-go-
9397
@@ -137,10 +141,10 @@ jobs:
137141
path: e2e/logs/
138142
retention-days: 7
139143

140-
# Signing E2E Tests
144+
# Signing E2E Tests (runs after keygen)
141145
e2e-signing:
142146
runs-on: ubuntu-latest
143-
needs: build
147+
needs: [build, e2e-keygen]
144148

145149
steps:
146150
- name: Checkout code
@@ -165,7 +169,7 @@ jobs:
165169
path: |
166170
~/.cache/go-build
167171
~/go/pkg/mod
168-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
172+
key: ${{ needs.build.outputs.go-cache-key }}
169173
restore-keys: |
170174
${{ runner.os }}-go-
171175
@@ -215,10 +219,10 @@ jobs:
215219
path: e2e/logs/
216220
retention-days: 7
217221

218-
# Resharing E2E Tests
222+
# Resharing E2E Tests (runs after signing)
219223
e2e-resharing:
220224
runs-on: ubuntu-latest
221-
needs: build
225+
needs: [build, e2e-signing]
222226

223227
steps:
224228
- name: Checkout code
@@ -243,7 +247,7 @@ jobs:
243247
path: |
244248
~/.cache/go-build
245249
~/go/pkg/mod
246-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
250+
key: ${{ needs.build.outputs.go-cache-key }}
247251
restore-keys: |
248252
${{ runner.os }}-go-
249253

0 commit comments

Comments
 (0)