Skip to content

Commit d30e33d

Browse files
authored
Added GitHub Actions
1 parent de439e8 commit d30e33d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- uses: reviewdog/action-staticcheck@v1
17+
with:
18+
github_token: ${{ secrets.github_token }}
19+
reporter: github-pr-review
20+
filter_mode: nofilter
21+
fail_on_error: true
22+
23+
build:
24+
runs-on: ubuntu-latest
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
go: [1.16, 1.17, 1.18]
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
- name: Setup Go
33+
uses: actions/setup-go@v3
34+
with:
35+
go-version: "${{ matrix.go }}"
36+
- name: Check Go code formatting
37+
run: |
38+
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
39+
gofmt -s -l .
40+
echo "Please format Go code by running: go fmt ./..."
41+
exit 1
42+
fi
43+
- name: Build
44+
run: |
45+
go vet ./...
46+
go test -v ./...
47+
go build ./...

0 commit comments

Comments
 (0)