-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (83 loc) · 2.5 KB
/
test.yml
File metadata and controls
102 lines (83 loc) · 2.5 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Test
on:
push:
tags:
- '*'
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- name: Download dependencies
run: find . -name go.mod -execdir go mod download \;
- name: Verify go.mod and go.sum are up to date
run: |
find . -name go.mod -execdir go mod tidy \;
if [ -n "$(git status --porcelain)" ]; then
echo "Error: go.mod or go.sum files are not up to date"
echo "Modified files:"
git diff
echo ""
echo "Please run 'go mod tidy' in all directories containing go.mod and commit the changes"
exit 1
fi
- name: Run tests with coverage
run: make test-coverage-and-junit
- name: Run E2E smoke test
run: make e2e-smoke-test
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Setup proto files
run: ./scripts/setup-proto-files.sh
- name: Generate proto descriptors
run: make proto-generate
- name: Download WireMock
run: make mock-download
- name: Start WireMock
run: make mock-start
- name: Run integration tests
run: make test-integration-coverage
- name: Stop WireMock
if: always()
run: make mock-stop
- name: Upload WireMock logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: wiremock-logs
path: wiremock/wiremock.log
if-no-files-found: ignore
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: unit
name: unit-tests
- name: Upload integration test coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage-integration.out
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
flags: integration
name: integration-tests