mirror of
https://github.com/robertkrimen/otto
synced 2025-10-12 20:27:30 +08:00

Remove skip-cache: true and restore skip-pkg-cache: true and skip-build-cache: true so that we still cache golangci-lint results which skip-cache: true disables.
43 lines
943 B
YAML
43 lines
943 B
YAML
name: Go test and lint
|
|
|
|
on:
|
|
pull_request:
|
|
branches: 'master'
|
|
|
|
jobs:
|
|
go-test-lint:
|
|
strategy:
|
|
matrix:
|
|
go: [1.19, 1.18]
|
|
golangcli: [v1.50.1]
|
|
os: [ubuntu-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
cache: true
|
|
|
|
- name: Validate go mod
|
|
run: |
|
|
go mod tidy
|
|
git --no-pager diff && [[ 0 -eq $(git status --porcelain | wc -l) ]]
|
|
|
|
- name: Go Lint
|
|
uses: golangci/golangci-lint-action@v3
|
|
with:
|
|
version: ${{ matrix.golangci }}
|
|
args: "--out-${NO_FUTURE}format colored-line-number"
|
|
skip-pkg-cache: true
|
|
skip-build-cache: true
|
|
|
|
- name: Go Build
|
|
run: go build ./...
|
|
|
|
- name: Go Test
|
|
run: go test -race -v ./...
|