-
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 1.92 KB
/
ci.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
75
76
77
78
79
80
81
name: CI
on:
push:
branches:
- main
paths-ignore:
- "!**/*.go"
- "!go.*"
- "!*.go"
pull_request:
paths-ignore:
- "!**/*.go"
- "!go.*"
- "!*.go"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.19", "1.21.x"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: go.sum
cache: true
- name: Build
run: make build
- name: Unit test
run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.out
flags: unittests
- name: Upload coverage
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage.out
- name: Benchmark test
run: make bench
# - name: Upload coverage to Codacy
# # run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.out --force-language go -t ${{ secrets.CODACY_PROJECT_TOKEN }}
# uses: codacy/codacy-coverage-reporter-action@v1
# with:
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
# coverage-reports: coverage.out
# - name: Run Codacy Analysis CLI
# uses: codacy/codacy-analysis-cli-action@master
static-check:
strategy:
fail-fast: false
matrix:
os: ["windows-latest", "ubuntu-latest", "macOS-latest"]
go: ["1.19"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: dominikh/staticcheck-action@v1.2.0
with:
version: latest
install-go: false
cache-key: ${{ matrix.go }}