-
Notifications
You must be signed in to change notification settings - Fork 10
87 lines (75 loc) · 2.1 KB
/
Copy pathtest.yaml
File metadata and controls
87 lines (75 loc) · 2.1 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: "Test"
on:
push:
branches:
- main
- v2
paths-ignore:
- '.run/**'
- 'docs/**'
- 'deployments/**'
- 'scripts/**'
- '*.md'
pull_request:
branches:
- main
- v2
types: [ opened, synchronize ]
paths-ignore:
- '.run/**'
- 'docs/**'
- 'deployments/**'
- 'scripts/**'
- '*.md'
jobs:
tests:
name: "Run tests"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker BuildX
id: buildx
uses: docker/setup-buildx-action@v4
- name: Cache Docker layers
uses: actions/cache@v5
with:
path: go-build-cache
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
- name: inject go-build-cache into docker
uses: reproducible-containers/buildkit-cache-dance@v3.3.2
with:
cache-map: |
{
"go-build-cache": "/root/.cache/go-build"
}
- name: Run tests
run: |
docker compose -f ./deployments/docker/docker-compose.test.yaml up --abort-on-container-failure
- name: Archive code coverage results
uses: actions/upload-artifact@v7
with:
name: code-coverage
path: tests/unit_coverage.out
- name: Archive code coverage results
uses: actions/upload-artifact@v7
with:
name: integration-coverage
path: tests/integration_coverage.out
code_coverage:
name: "Code coverage report"
if: github.event_name == 'pull_request' # Do not run when workflow is triggered by push to main branch
runs-on: ubuntu-latest
needs: tests
continue-on-error: true # not critical
permissions:
contents: read
actions: read
pull-requests: write # write permission needed to comment on PR
steps:
- uses: fgrosse/go-coverage-report@v1.3.0
with:
coverage-artifact-name: code-coverage
coverage-file-name: unit_coverage.out