-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 1.88 KB
/
reusable-CI-workflow.yml
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
name: 'CI reusable workflow'
on:
workflow_call:
jobs:
coverage:
name: Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
check-latest: true
cache: true
cache-dependency-path: ./go.sum
- name: Build
run: make build
- name: Run tests
run: make test-go gotest_o="-race -covermode=atomic -coverprofile=coverage.out"
- name: Create coverage group
id: tests-coverage-group
uses: yoanm/temp-reports-group-workspace/create-group@v0
with:
format: clover
files: coverage.out
path: build/coverage-groups
- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage-group
path: build/coverage-groups
if-no-files-found: error
static:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
check-latest: true
cache: true
cache-dependency-path: ./go.sum
- name: Verify dependencies
run: make verify-deps
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.57
- name: Documentation
env:
CI: false # If true, command thinks it's goreadme GHAction context (see https://github.com/posener/goreadme/issues/120)
run: |
make configure-dev-env && make build-doc
if [ ! "$(git status -s | wc -l)" -eq 0 ]; then
echo "::error::Documentation is not up to date ! Run 'make build-doc' "
exit 1;
fi
echo "Documentation is up to date 👌"
exit 0