Skip to content

Commit d3038cd

Browse files
authored
split test-with-coverage.yml workflow (#505)
* split test-with-coverage.yml workflow * removing step not needed
1 parent 10ca562 commit d3038cd

File tree

2 files changed

+49
-34
lines changed

2 files changed

+49
-34
lines changed
Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,29 @@
1-
name: ci-build
1+
name: test-with-coverage
22
on:
3-
push:
4-
branches:
5-
- master
6-
tags-ignore:
7-
- '*.*'
8-
pull_request_target:
9-
types: [ opened, synchronize, reopened, ready_for_review ]
10-
branches:
11-
- master
3+
pull_request:
4+
branches: [ master ]
125

136
jobs:
14-
test-with-coverage:
15-
name: Test with Coverage
7+
test:
168
runs-on: ubuntu-24.04
9+
1710
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v6
20-
with:
21-
ref: ${{github.event.pull_request.head.ref}}
22-
repository: ${{github.event.pull_request.head.repo.full_name}}
23-
fetch-depth: 0
11+
- name: Checkout PR code
12+
uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Install Go
17+
uses: actions/setup-go@v6
18+
with:
19+
go-version-file: go.mod
20+
21+
- name: Test
22+
run: |
23+
make test-with-coverage
2424
25-
- name: Install Go
26-
uses: actions/setup-go@v6
27-
with:
28-
go-version-file: go.mod
29-
30-
- name: Test
31-
run: |
32-
make test-with-coverage
33-
- name: Upload code coverage
34-
uses: codecov/codecov-action@v5
35-
with:
36-
token: ${{ secrets.CODECOV_TOKEN }}
37-
files: ./out/coverage/coverage.txt
38-
flags: unittests # optional
39-
fail_ci_if_error: true # optional (default = false)
40-
verbose: true # optional (default = false)
25+
- name: Upload coverage artifact
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: coverage
29+
path: ./build/_output/coverage/coverage.txt
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: upload-coverage
2+
on:
3+
workflow_run:
4+
workflows: [ test-with-coverage ]
5+
types: [ completed ]
6+
7+
jobs:
8+
upload-coverage:
9+
if: >
10+
github.event.workflow_run.conclusion == 'success'
11+
runs-on: ubuntu-24.04
12+
13+
steps:
14+
- name: Download coverage artifact
15+
uses: actions/download-artifact@v4
16+
with:
17+
name: coverage
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
run-id: ${{ github.event.workflow_run.id }}
20+
21+
- name: Upload to Codecov
22+
uses: codecov/codecov-action@v5
23+
with:
24+
token: ${{ secrets.CODECOV_TOKEN }}
25+
files: build/_output/coverage/coverage.txt
26+
fail_ci_if_error: true

0 commit comments

Comments
 (0)