CI: upgrade GitHub Actions #28
Workflow file for this run
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: Test | |
on: [ push, pull_request ] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: | |
- 1.21.x | |
- 1.20.x | |
- 1.19.x | |
- 1.18.x | |
- 1.17.x | |
- 1.16.x | |
- 1.15.x | |
- 1.14.x | |
- 1.13.x | |
- 1.12.x | |
- 1.11.x | |
- 1.10.x | |
- 1.9.x | |
- 1.8.x | |
os: | |
- ubuntu-latest | |
- macos-latest | |
exclude: | |
# Old Go releases fail on recent MacOS. | |
- os: macos-latest | |
go-version: 1.10.x | |
- os: macos-latest | |
go-version: 1.9.x | |
- os: macos-latest | |
go-version: 1.8.x | |
#arch: | |
# - amd64 | |
# - ppc64le | |
# - s390x | |
# - arm64 | |
runs-on: ${{ matrix.os }} | |
env: | |
GOPATH: ${{ github.workspace }} | |
GO111MODULE: on | |
defaults: | |
run: | |
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | |
steps: | |
# https://github.com/mvdan/github-actions-golang | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }} | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Check Import path | |
run: GO111MODULE=off go list # Verify that go_import_path is ok for go < 1.11 | |
- name: Install dependencies | |
shell: bash | |
# Fetch dependencies: | |
# - go < 1.11: | |
# - go get -v -t ./... | |
# - go get -v -t -tags generate ./... | |
# - go >= 1.11: | |
# - go list -mod=readonly -test | |
# - go list -mod=readonly -tags generate | |
run: "case \"$(go version)\" in (*' go1.'[02-9]*|*' go1.10.'*) go get -t -v ./... && go get -v -tags generate ./... ;; (*) go list -mod=readonly -test && go list -mod=readonly -tags generate ;; esac" | |
- name: Test | |
run: go test -coverprofile=coverage.txt -covermode=atomic | |
- name: Send coverage to Codecov.io | |
shell: bash | |
run: bash <(curl -s https://codecov.io/bash) | |
- name: go vet | |
shell: bash | |
run: go vet | |
- name: go vet, for generators | |
shell: bash | |
run: go vet -tags generate |