This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (53 loc) · 1.72 KB
/
go.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
name: Build and Test
on: [push, pull_request]
jobs:
build:
name: Go CI
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.16
- name: Install mage
run: "pushd /tmp; git clone https://github.com/magefile/mage; pushd mage; go run bootstrap.go; popd; popd"
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.44.0
golangci-lint --version
- name: Install Protobuf compiler
uses: arduino/setup-protoc@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Protobuf Go plugin
run: go get github.com/golang/protobuf/protoc-gen-go
- name: Install Buf compiler
env:
BUF_VERSION: "0.20.1"
BUF: "/var/tmp/buf"
run: |
UNAME_OS=$(uname -s)
UNAME_ARCH=$(uname -m)
wget "https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-${UNAME_OS}-${UNAME_ARCH}" -O ${BUF}
chmod +x ${BUF}
- name: Run Buf checks
env:
BUF: "/var/tmp/buf"
run: mage -v buf
- name: Build
run: |
mage -v build
- name: Run golangci-lint
run: |
mage -v lint
- name: Test (with -race flag)
run: mage -v testracecover
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true