Skip to content

Commit 39d752f

Browse files
committed
Use workflow concurrency instead of skipping action
1 parent b35b55f commit 39d752f

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ jobs:
3535
restore-keys: |
3636
${{ runner.os }}-python-${{ matrix.python-version }}-codeql-${{ hashFiles('requirements*.txt') }}
3737
${{ runner.os }}-python-${{ matrix.python-version }}-tests-${{ hashFiles('requirements*.txt') }}
38+
${{ runner.os }}-python-${{ matrix.python-version }}-release-${{ hashFiles('requirements*.txt') }}
3839
${{ runner.os }}-python-${{ matrix.python-version }}-codeql-
3940
${{ runner.os }}-python-${{ matrix.python-version }}-tests-
41+
${{ runner.os }}-python-${{ matrix.python-version }}-release-
4042
${{ runner.os }}-python
4143
${{ runner.os }}-
4244

.github/workflows/release.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ on:
66
- v*
77

88
jobs:
9-
10-
wait:
9+
wait-tests:
1110
name: Wait for tests
1211
runs-on: ubuntu-latest
1312

@@ -24,10 +23,27 @@ jobs:
2423
uses: cutenode/action-always-fail@v1
2524
if: steps.wait-for-tests.outputs.conclusion != 'success'
2625

26+
wait-codeql:
27+
name: Wait for CodeQL
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- uses: fountainhead/[email protected]
32+
id: wait-for-codeql
33+
with:
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
checkName: Analyze
36+
ref: ${{ github.sha }}
37+
timeoutSeconds: 3600
38+
39+
- name: Fail the Build
40+
uses: cutenode/action-always-fail@v1
41+
if: steps.wait-for-codeql.outputs.conclusion != 'success'
42+
2743
release:
2844
name: Release package
2945
runs-on: ubuntu-latest
30-
needs: [wait]
46+
needs: [wait-tests, wait-codeql]
3147

3248
steps:
3349
- name: Checkout code
@@ -44,10 +60,14 @@ jobs:
4460
uses: actions/cache@v3
4561
with:
4662
path: ~/.cache/pip
47-
key: ${{ runner.os }}-python-3.10-pip-${{ hashFiles('requirements.txt') }}
63+
key: ${{ runner.os }}-python-3.10-release-${{ hashFiles('requirements*.txt') }}
4864
restore-keys: |
49-
${{ runner.os }}-python-3.10-pip-${{ hashFiles('requirements.txt') }}
50-
${{ runner.os }}-python-3.10-pip-
65+
${{ runner.os }}-python-3.10-release-${{ hashFiles('requirements*.txt') }}
66+
${{ runner.os }}-python-3.10-tests-${{ hashFiles('requirements*.txt') }}
67+
${{ runner.os }}-python-3.10-codeql-${{ hashFiles('requirements*.txt') }}
68+
${{ runner.os }}-python-3.10-release-
69+
${{ runner.os }}-python-3.10-tests-
70+
${{ runner.os }}-python-3.10-codeql-
5171
${{ runner.os }}-python
5272
${{ runner.os }}-
5373

.github/workflows/test.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,14 @@ on:
88
branches:
99
- master
1010

11-
jobs:
12-
check_duplicate_runs:
13-
name: Check for duplicate runs
14-
continue-on-error: true
15-
runs-on: ubuntu-latest
16-
outputs:
17-
should_skip: ${{ steps.skip_check.outputs.should_skip }}
18-
steps:
19-
- id: skip_check
20-
uses: fkirc/skip-duplicate-actions@v5
21-
with:
22-
github_token: ${{ secrets.GITHUB_TOKEN }}
23-
concurrent_skipping: same_content_newer
24-
cancel_others: true
25-
skip_after_successful_duplicate: false
26-
paths_ignore: '["**/README.md", "**/LICENSE"]'
27-
do_not_skip: '["push"]'
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
2814

15+
jobs:
2916
tests:
3017
name: Run ${{ matrix.mark}} tests (${{ matrix.python-version }} on ${{ matrix.os }})
3118
runs-on: ${{ matrix.os }}
32-
needs: [check_duplicate_runs]
33-
if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }}
3419
strategy:
3520
fail-fast: false
3621
matrix:
@@ -69,8 +54,10 @@ jobs:
6954
restore-keys: |
7055
${{ runner.os }}-python-${{ matrix.python-version }}-tests-${{ hashFiles('requirements*.txt') }}
7156
${{ runner.os }}-python-${{ matrix.python-version }}-codeql-${{ hashFiles('requirements*.txt') }}
57+
${{ runner.os }}-python-${{ matrix.python-version }}-release-${{ hashFiles('requirements*.txt') }}
7258
${{ runner.os }}-python-${{ matrix.python-version }}-tests-
7359
${{ runner.os }}-python-${{ matrix.python-version }}-codeql-
60+
${{ runner.os }}-python-${{ matrix.python-version }}-release-
7461
${{ runner.os }}-python
7562
${{ runner.os }}-
7663

0 commit comments

Comments
 (0)