lubimyczytacrss/.github/workflows/pr.yml

56 lines
1.2 KiB
YAML
Raw Normal View History

2022-05-26 04:28:59 +00:00
name: PR checks
on:
push:
branches:
- master
pull_request:
env:
GO_VERSION: 1.19.x
2022-05-26 04:28:59 +00:00
jobs:
go-mod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Check go mod
run: |
go mod tidy
git diff --exit-code go.mod
2022-05-26 04:28:59 +00:00
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.48
2022-05-26 04:28:59 +00:00
tests:
strategy:
matrix:
go: [ 1.19.x ]
2022-05-26 04:28:59 +00:00
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Run go vet
run: go vet ./...
- name: Run go build
run: go build
- name: Run tests
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...