Skip to content

Commit 8cfaa12

Browse files
authored
ci: separate PR coverage from test matrix (#2180)
1 parent 4d217a3 commit 8cfaa12

5 files changed

Lines changed: 54 additions & 11 deletions

File tree

.github/workflows/_coverage.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Reusable Coverage
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
CODECOV_TOKEN:
7+
required: false
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
coverage:
14+
uses: ./.github/workflows/_test.yml
15+
secrets:
16+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
17+
with:
18+
os: Ubuntu
19+
image: ubuntu-latest
20+
python-version: "3.11"
21+
with-coverage: true

.github/workflows/develop-coverage.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ permissions:
1212

1313
jobs:
1414
develop-coverage:
15-
uses: ./.github/workflows/_test.yml
15+
uses: ./.github/workflows/_coverage.yml
1616
secrets:
1717
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
18-
with:
19-
os: Ubuntu
20-
image: ubuntu-latest
21-
python-version: "3.11"
22-
with-coverage: true

.github/workflows/pr-coverage.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PR Coverage
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "**/*.md"
7+
- ".github/**"
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: pr-coverage-${{ github.event.pull_request.number }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
pr-coverage:
18+
uses: ./.github/workflows/_coverage.yml
19+
secrets:
20+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
21+
pr-coverage-summary:
22+
name: PR Coverage Summary
23+
needs: pr-coverage
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Confirm PR coverage passed
27+
run: echo "PR coverage completed successfully"

.github/workflows/pr-tests-skip.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- run: echo "Tests skipped (no code changes)"
17+
pr-coverage-summary:
18+
name: PR Coverage Summary
19+
runs-on: ubuntu-latest
20+
steps:
21+
- run: echo "Coverage skipped (no code changes)"

.github/workflows/pr-tests.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,12 @@ jobs:
1818
include:
1919
- os: Ubuntu
2020
image: ubuntu-latest
21-
- python-version: "3.11"
22-
with-coverage: true
2321
fail-fast: false
2422
uses: ./.github/workflows/_test.yml
25-
secrets:
26-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2723
with:
2824
os: ${{ matrix.os }}
2925
image: ${{ matrix.image }}
3026
python-version: ${{ matrix.python-version }}
31-
with-coverage: ${{ matrix.with-coverage || false }}
3227
pr-tests-summary:
3328
name: PR Tests Summary
3429
needs: pr-tests-matrix

0 commit comments

Comments
 (0)