jwt/.github/workflows/build.yml

54 lines
1.4 KiB
YAML
Raw 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:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
2021-05-27 15:50:10 +03:00
matrix:
go: ["1.20", "1.21", "1.22"]
2021-05-27 15:50:10 +03:00
steps:
- name: Checkout
uses: actions/checkout@v4
2021-05-27 15:50:10 +03:00
- name: Setup Go
uses: actions/setup-go@v5
2021-05-27 15:50:10 +03:00
with:
go-version: "${{ matrix.go }}"
check-latest: true
- 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 install github.com/mfridman/tparse@latest
2021-05-27 15:50:10 +03:00
go vet ./...
go test -v -race -count=1 -json -cover ./... | tee output.json | tparse -follow -notests || true
2023-02-19 16:01:18 +03:00
tparse -format markdown -file output.json -all > $GITHUB_STEP_SUMMARY
2021-05-27 15:50:10 +03:00
go build ./...
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
- name: Coverage
run: |
go test -v -covermode=count -coverprofile=coverage.cov ./...
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
file: coverage.cov
format: golang