-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (44 loc) · 1.12 KB
/
golang.yaml
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
name: golang
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
cache-dependency-path: go.sum
- name: build
run: go build -v ./...
- name: test
run: go test ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
cache-dependency-path: go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v5
with:
install-mode: "binary"
version: "v1.58.0"
# https://github.com/golangci/golangci-lint-action/issues/244
# https://github.com/Kong/mesh-perf/pull/168
skip-cache: true
- name: go mod tidy
run: go mod tidy
- name: check for any changes
run: |
[[ $(git status --porcelain) == "" ]] || (echo "changes detected" && exit 1)