-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (58 loc) · 1.79 KB
/
build.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
name: build
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
env:
GOPRIVATE: github.com/dispatchrun,buf.build/gen/go
GOVERSION: 1.22.0
jobs:
lint:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: bufbuild/[email protected]
with:
buf_user: ${{ secrets.BUF_USER }}
buf_api_token: ${{ secrets.BUF_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GOVERSION }}
- run: git config --global url.https://${{ secrets.PRIVATE_REPO }}@github.com.insteadOf https://github.com
- run: go mod download
- uses: golangci/golangci-lint-action@v3
with:
version: v1.54.2
args: --timeout 4m
# Disable caching as a workaround for https://github.com/golangci/golangci-lint-action/issues/135.
skip-pkg-cache: true
test:
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ matrix.os }}-${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
permissions:
id-token: write
contents: read
steps:
- uses: bufbuild/[email protected]
with:
buf_user: ${{ secrets.BUF_USER }}
buf_api_token: ${{ secrets.BUF_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GOVERSION }}
- run: git config --global url.https://${{ secrets.PRIVATE_REPO }}@github.com.insteadOf https://github.com
- run: go mod download
- run: make test-cover