separate method to keep backwards compatibility #215
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push, pull_request] | |
jobs: | |
golangci: | |
name: Lint | |
runs-on: ubuntu-latest | |
# Prevent duplicate builds on internal PRs. | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.54.2 | |
args: --timeout 3m0s | |
build: | |
name: Test with Go ${{ matrix.go-version }} | |
runs-on: ubuntu-latest | |
# Prevent duplicate builds on internal PRs. | |
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
strategy: | |
matrix: | |
go-version: ["1.20", "1.21"] | |
steps: | |
- name: Install Go stable version | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Test | |
run: go test -v |