Skip to content

Update .github/workflows/ci.yml #61

Update .github/workflows/ci.yml

Update .github/workflows/ci.yml #61

Workflow file for this run

name: CI
on:
- push
- pull_request
jobs:
test:
strategy:
matrix:
platform:
- Linux
- macOS
- Windows
go-version:
- '1.21'
- '1.22'
- '1.23'
architecture:
- 386
- amd64
- arm64
include:
- platform: Linux
os: ubuntu-latest
- platform: macOS
os: macos-latest
- platform: macOS
os: macos-13
architecture: amd64
- platform: Windows
os: windows-latest
exclude:
- platform: Linux
architecture: 386
- platform: Linux
architecture: arm64
- platform: macOS
architecture: 386
- platform: Windows
architecture: arm64
fail-fast: false
name: Go ${{ matrix.go-version }} (${{ matrix.architecture }}) on ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
architecture: ${{ matrix.architecture }}
- name: Download modules
run: go mod download
- name: Test (386)
if: matrix.architecture == '386'
run: go test -v -coverprofile coverage.txt ./...
- name: Test (amd64)
if: matrix.architecture == 'amd64'
run: go test -v -race -coverprofile coverage.txt ./...
- name: Vet
run: go vet -unsafeptr=false ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: GO
fail_ci_if_error: true
flags: ${{ matrix.platform }}
env:
GO: ${{ matrix.go-version }}