CI: unify arm64 && amd64 integration test #554
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
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ '**' ] | |
# Set default permissions as read only. | |
permissions: read-all | |
name: Go | |
jobs: | |
go-test: | |
strategy: | |
matrix: | |
go-version: [1.13.x, 1.21.x, 1.22.x, 1.23.x] | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
exclude: | |
# There is no arm64 version of Go for darwin. | |
# This exclude can be removed if the minimal Go version | |
# is > Go 1.16. | |
- go-version: "1.13.x" | |
platform: "macos-latest" | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Download Go dependencies | |
env: | |
GOPROXY: "https://proxy.golang.org" | |
run: go mod download | |
- name: Simple Tests | |
if: matrix.platform != 'ubuntu-latest' | |
run: go test -count=1 ./... | |
- name: Test with -race | |
if: matrix.platform == 'ubuntu-latest' | |
run: go test -race -count=3 ./... | |
- name: Test with -shuffle=on | |
if: matrix.platform == 'ubuntu-latest' && startsWith(matrix.go-version, '1.2') | |
run: go test -shuffle=on -count=3 ./... | |
- name: Integrationtest for linux | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
go test -race -v -exec=sudo -tags integration -covermode=atomic -coverprofile=profile.cov ./... | |
- name: coveralls.io | |
if: matrix.platform == 'ubuntu-latest' && startsWith(matrix.go-version, '1.23') | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
go install github.com/mattn/[email protected] | |
goveralls -v -tags integration -coverprofile=profile.cov -service=github | |
code-check: | |
strategy: | |
matrix: | |
go-version: [1.23.x] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Download Go dependencies | |
env: | |
GOPROXY: "https://proxy.golang.org" | |
run: go mod download | |
- name: golint | |
run: | | |
go install golang.org/x/lint/golint@latest | |
$(go env GOPATH)/bin/golint $(go list ./... | grep -v internal/unix) | |
- name: staticcheck.io | |
uses: dominikh/[email protected] | |
with: | |
version: "2024.1.1" | |
install-go: false | |
cache-key: ${{ matrix.go }} |