-
Notifications
You must be signed in to change notification settings - Fork 362
52 lines (43 loc) · 1.14 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
name: continuous integration
on:
push:
paths:
- '**.go'
- go.sum
- go.mod
branches-ignore:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: Deps cache
id: cache-go-deps
uses: actions/cache@v4
env:
cache-name: go-deps-cache
with:
path: ~/godeps
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- if: ${{ steps.cache-go-deps.outputs.cache-hit != 'true' }}
name: List the state of go modules
continue-on-error: true
run: go mod graph
- name: Install dependencies
run: |
go mod tidy
go mod download
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2
- name: Run golangci-lint
run: golangci-lint run
- name: Run tests
run: |
go test ./...