jwt/.github/workflows/build.yml

48 lines
1.1 KiB
YAML
Raw Permalink Normal View History

2021-05-27 15:50:10 +03:00
name: build
on:
push:
branches:
- main
2021-05-27 15:50:10 +03:00
pull_request:
types: [opened, synchronize, reopened]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
2022-03-18 14:15:45 +03:00
uses: actions/checkout@v3
- 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:
fail-fast: false
2021-05-27 15:50:10 +03:00
matrix:
2022-03-18 14:15:45 +03:00
go: [1.16, 1.17, 1.18]
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:
go-version: "${{ matrix.go }}"
- 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: |
go vet ./...
go test -v ./...
go build ./...