Skip to content

Commit 48bf72a

Browse files
committed
ci: update GitHub Actions workflow for Golang project
Signed-off-by: Daniel Hu <[email protected]>
1 parent 782ee3c commit 48bf72a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Set up Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.20
19+
20+
- name: Check out code
21+
uses: actions/checkout@v2
22+
23+
- name: Install dependencies
24+
run: |
25+
go install golang.org/x/tools/cmd/goimports@latest
26+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
27+
28+
- name: Format and vet code
29+
run: |
30+
make fmt
31+
make vet
32+
33+
- name: Run tests
34+
run: go test ./...
35+
36+
- name: Build project
37+
run: make build

0 commit comments

Comments
 (0)