-
-
Notifications
You must be signed in to change notification settings - Fork 37
112 lines (94 loc) · 3.48 KB
/
ci.yml
File metadata and controls
112 lines (94 loc) · 3.48 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
103
104
105
106
107
108
109
110
111
112
name: build
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG: 1
steps:
- name: Show rate limit
run: |
curl -sL -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/rate_limit
- name: Check out source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- name: Run lint
uses: reviewdog/action-golangci-lint@c76cceaaab89abe74e649d2e34c6c9adc26662d2 # v2.10.0
with:
go_version_file: go.mod
cache: false
fail_level: warning
- name: Run gostyle
uses: k1LoW/gostyle-action@e1b847d37b3041c5fdb8b911bcf00b350779ca61 # v1.5.1
with:
config-file: .gostyle.yml
fail-on-error: true
env:
GOTOOLCHAIN: auto
- name: Run govulncheck
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
with:
go-version-input: ''
go-version-file: go.mod
repo-checkout: false
go-package: ./...
- name: Run tests
run: make ci
- name: Run test_central
if: ${{ github.event_name == 'pull_request' }}
run: make test_central
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
with:
scan-type: 'fs'
- name: Build octocov and run as a action
uses: ./testdata/actions/coverage
env:
MACKEREL_API_KEY: ${{ secrets.MACKEREL_API_KEY }}
OCTOCOV_CUSTOM_METRICS_BENCHMARK_1: ./testdata/custom_metrics/benchmark_1.json
OCTOCOV_CUSTOM_METRICS_BENCHMARK_0: ./testdata/custom_metrics/benchmark_0.json
GOTOOLCHAIN: 'go${{ steps.setup-go.outputs.go-version }}'
- name: 'RE: Build octocov and run as a action' # for checking re-upload artifact
uses: ./testdata/actions/coverage
env:
MACKEREL_API_KEY: ${{ secrets.MACKEREL_API_KEY }}
OCTOCOV_CUSTOM_METRICS_BENCHMARK_1: ./testdata/custom_metrics/benchmark_1.json
OCTOCOV_CUSTOM_METRICS_BENCHMARK_0: ./testdata/custom_metrics/benchmark_0.json
GOTOOLCHAIN: 'go${{ steps.setup-go.outputs.go-version }}'
- name: Show rate limit
run: |
curl -sL -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/rate_limit
test-windows:
name: Test for Windows
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG: 1
steps:
- name: Use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out source code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Go
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
check-latest: true
- name: Run tests
run: make ci
- name: Run test_central
if: ${{ github.event_name == 'pull_request' }}
run: make test_central