-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (77 loc) · 1.82 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
name: CI
"on":
push:
branches:
- master
paths-ignore:
- README.md
pull_request:
branches:
- '*'
paths-ignore:
- README.md
env:
GO_VERSION: "1.22"
TRIVY_VERSION: "v0.44.1"
COG_VERSION: "5.2.0"
LINTER_VERSION: "v1.59.1"
permissions:
contents: read
jobs:
build:
name: Build
timeout-minutes: 15
needs:
- lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Make build
run: make build
lint:
name: Lint
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Cache golangci-lint
id: golangci-lint
uses: actions/cache@v3
with:
path: |
~/.cache/golangci-lint
key: ${{ runner.os }}-golangci-lint
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $HOME/.local/bin ${{ env.LINTER_VERSION }}
- name: Lint all modules with golangci-lint
run: |
PATH=$PATH:$HOME/.local/bin make lint
test:
name: Test
needs:
- build
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Run tests and generate coverage report
run: make test