chore: fix CD workflow #23
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: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- name: Install revive | |
run: go install github.com/mgechev/revive@latest | |
- name: Install staticcheck | |
run: go install honnef.co/go/tools/cmd/staticcheck@latest | |
- name: Check | |
run: make check | |
build: | |
name: Build and test | |
needs: check | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
goos: linux | |
goarch: amd64 | |
- os: windows-latest | |
goos: windows | |
goarch: amd64 | |
- os: macos-11 | |
goos: darwin | |
goarch: amd64 | |
- os: macos-latest | |
goos: darwin | |
goarch: arm64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
- name: Build | |
run: make build | |
env: | |
CGO_ENABLED: 0 | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
- name: Test | |
run: make test |