Repository navigation
69 lines (62 loc) · 1.83 KB
/
Copy pathpull_request.yml
File metadata and controls
69 lines (62 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: CI Build
# Cancel older, in-progress CI runs on the same branch/PR
concurrency:
group: ci-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Linter
run: >
DOCKER_BUILDKIT=1 docker build
--target=linter
--progress=plain
.
test_and_coverage:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test and collect coverage
continue-on-error: true
run: >
DOCKER_BUILDKIT=1 docker build
--target=coverage_export
--output type=local,dest=coverage
--build-arg KEY=${{ secrets.KEY }}
--build-arg SECRET=${{ secrets.SECRET }}
--build-arg CONDUCTOR_SERVER_URL=${{ secrets.CONDUCTOR_SERVER_URL }}
.
# Always upload the XML, even if tests failed
- name: Upload Cobertura artifact
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: cobertura
path: coverage/out/coverage.cobertura.xml
- name: Ensure coverage file exists
run: |
mkdir -p coverage
if [ ! -f coverage/out/coverage.cobertura.xml ]; then
echo '<coverage></coverage>' > coverage/out/coverage.cobertura.xml
fi
- name: Codecov upload
if: ${{ !env.ACT }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/out/coverage.cobertura.xml
flags: unittests
name: ${{ github.workflow }}-${{ github.job }}-${{ github.run_number }}