Files
lf/.github/workflows/go.yml
T
Joe Lim f4ae38f575 Run cross build in parallel for CI (#2171)
* Run cross build in parallel for CI

* Intentional failure

* Revert "Intentional failure"

This reverts commit 27521305d7.

* reorder

* Rename step
2025-09-20 00:31:04 +10:00

106 lines
2.8 KiB
YAML

name: Go
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Check formatting
run: go fmt && git diff --exit-code
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
- uses: dominikh/staticcheck-action@v1.4.0
with:
version: "2025.1.1"
install-go: false
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { os: android, arch: arm64 }
- { os: darwin, arch: amd64 }
- { os: darwin, arch: arm64 }
- { os: dragonfly, arch: amd64 }
- { os: freebsd, arch: "386" }
- { os: freebsd, arch: amd64 }
- { os: freebsd, arch: arm }
- { os: illumos, arch: amd64 }
- { os: linux, arch: "386" }
- { os: linux, arch: amd64 }
- { os: linux, arch: arm }
- { os: linux, arch: arm64 }
- { os: linux, arch: ppc64 }
- { os: linux, arch: ppc64le }
- { os: linux, arch: mips }
- { os: linux, arch: mipsle }
- { os: linux, arch: mips64 }
- { os: linux, arch: mips64le }
- { os: linux, arch: s390x }
- { os: netbsd, arch: "386" }
- { os: netbsd, arch: amd64 }
- { os: netbsd, arch: arm }
- { os: openbsd, arch: "386" }
- { os: openbsd, arch: amd64 }
- { os: openbsd, arch: arm }
- { os: openbsd, arch: arm64 }
- { os: solaris, arch: amd64 }
- { os: windows, arch: "386" }
- { os: windows, arch: amd64 }
# Unsupported
# - { os: aix, arch: ppc64 }
# - { os: android, arch: "386" }
# - { os: android, arch: amd64 }
# - { os: android, arch: arm }
# - { os: js, arch: wasm }
# - { os: plan9, arch: "386" }
# - { os: plan9, arch: amd64 }
# - { os: plan9, arch: arm }
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # https://github.com/actions/checkout/issues/2199
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build
run: gen/build.sh
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}