Repository navigation
66 lines (55 loc) · 1.63 KB
/
Copy pathbuild.yml
File metadata and controls
66 lines (55 loc) · 1.63 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
name: Build
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
name: Checkout Code
- name: Install Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
# Use git status, not git diff: status also catches untracked files.
- name: check go.mod
run: |
go mod tidy
test -z "$(git status --porcelain)"
- name: check vendor
run: |
go mod vendor
test -z "$(git status --porcelain)"
- name: check protobuf
run: |
go -C tools install github.com/bufbuild/buf/cmd/buf google.golang.org/protobuf/cmd/protoc-gen-go
PATH="$(go env GOPATH)/bin:$PATH" buf generate
test -z "$(git status --porcelain)"
- name: check mocks
run: |
go -C tools install github.com/vektra/mockery/v3
rm -f internal/bft/mocks/*.go
PATH="$(go env GOPATH)/bin:$PATH" mockery --config .mockery.yml
test -z "$(git status --porcelain)"
- name: golangci-lint
run: |
go -C tools install github.com/golangci/golangci-lint/v2/cmd/golangci-lint
PATH="$(go env GOPATH)/bin:$PATH" golangci-lint run ./...
build:
needs:
- validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
name: Checkout Code
- name: Install Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Test
run: |
go test -count 1 -race ./...