2021-05-27 15:50:10 +03:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-05-29 13:05:28 +03:00
|
|
|
- main
|
2021-05-27 15:50:10 +03:00
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
|
|
|
|
jobs:
|
2021-08-03 16:51:01 +03:00
|
|
|
check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-18 14:15:45 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-08-03 16:51:01 +03:00
|
|
|
- uses: reviewdog/action-staticcheck@v1
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.github_token }}
|
|
|
|
reporter: github-pr-review
|
|
|
|
filter_mode: nofilter
|
|
|
|
fail_on_error: true
|
|
|
|
|
2021-05-27 15:50:10 +03:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2021-05-28 16:35:34 +03:00
|
|
|
fail-fast: false
|
2021-05-27 15:50:10 +03:00
|
|
|
matrix:
|
2022-08-20 17:53:04 +03:00
|
|
|
go: [1.17, 1.18, 1.19]
|
2021-05-27 15:50:10 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-18 14:15:45 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-05-27 15:50:10 +03:00
|
|
|
- name: Setup Go
|
2022-03-18 14:15:45 +03:00
|
|
|
uses: actions/setup-go@v3
|
2021-05-27 15:50:10 +03:00
|
|
|
with:
|
2021-05-28 16:35:34 +03:00
|
|
|
go-version: "${{ matrix.go }}"
|
2022-11-29 18:00:41 +03:00
|
|
|
check-latest: true
|
|
|
|
cache: true
|
2022-05-28 17:03:15 +03:00
|
|
|
- name: Check Go code formatting
|
|
|
|
run: |
|
|
|
|
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
|
|
|
|
gofmt -s -l .
|
|
|
|
echo "Please format Go code by running: go fmt ./..."
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-05-27 15:50:10 +03:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2022-11-29 18:00:41 +03:00
|
|
|
go install github.com/mfridman/tparse@latest
|
2021-05-27 15:50:10 +03:00
|
|
|
go vet ./...
|
2022-12-03 22:48:14 +03:00
|
|
|
go test -v -race -count=1 -json -coverpkg=$(go list ./...) ./... | tee output.json | tparse -follow -notests || true
|
|
|
|
tparse -format markdown -file output.json
|
2021-05-27 15:50:10 +03:00
|
|
|
go build ./...
|