2019-12-06 11:22:07 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2022-11-03 17:16:10 +00:00
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- goos: js
|
|
|
|
goarch: wasm
|
|
|
|
- goos: aix
|
|
|
|
goarch: ppc64
|
|
|
|
|
|
|
|
steps:
|
2023-06-03 12:59:37 +00:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2022-11-03 17:16:10 +00:00
|
|
|
- name: Set up Go
|
2023-03-15 17:14:10 +00:00
|
|
|
uses: actions/setup-go@v4
|
2022-11-03 17:16:10 +00:00
|
|
|
with:
|
2023-02-05 17:14:57 +00:00
|
|
|
go-version: '1.20'
|
2022-11-03 17:16:10 +00:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: go build .
|
|
|
|
env:
|
|
|
|
GOOS: ${{ matrix.goos }}
|
|
|
|
GOARCH: ${{ matrix.goarch }}
|
|
|
|
|
2021-09-21 16:15:31 +00:00
|
|
|
test:
|
|
|
|
name: Test
|
2020-09-05 21:53:06 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-12-06 11:22:07 +00:00
|
|
|
strategy:
|
2021-09-21 09:25:18 +00:00
|
|
|
# Fail fast is disabled because there are Go version specific features and tests
|
|
|
|
# that should be able to fail independently.
|
|
|
|
fail-fast: false
|
2019-12-06 11:22:07 +00:00
|
|
|
matrix:
|
2021-09-21 09:26:55 +00:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2023-02-05 17:14:57 +00:00
|
|
|
go: ['1.17', '1.18', '1.19', '1.20']
|
2019-12-06 11:22:07 +00:00
|
|
|
env:
|
|
|
|
GOFLAGS: -mod=readonly
|
|
|
|
|
|
|
|
steps:
|
2023-06-03 12:59:37 +00:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2019-12-06 11:22:07 +00:00
|
|
|
- name: Set up Go
|
2023-03-15 17:14:10 +00:00
|
|
|
uses: actions/setup-go@v4
|
2019-12-06 11:22:07 +00:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
|
|
|
|
2021-09-21 16:15:31 +00:00
|
|
|
- name: Test
|
2023-01-19 14:16:19 +00:00
|
|
|
run: go test -race -v ./...
|
2021-12-28 08:37:48 +00:00
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
- name: Test (without race detector)
|
2023-01-19 14:16:19 +00:00
|
|
|
run: go test -v ./...
|
2021-12-28 08:37:48 +00:00
|
|
|
if: runner.os == 'Windows'
|
2021-09-21 16:15:31 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GOFLAGS: -mod=readonly
|
|
|
|
|
|
|
|
steps:
|
2023-06-03 12:59:37 +00:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2021-09-21 16:15:31 +00:00
|
|
|
- name: Set up Go
|
2023-03-15 17:14:10 +00:00
|
|
|
uses: actions/setup-go@v4
|
2021-09-21 16:15:31 +00:00
|
|
|
with:
|
2023-02-05 17:14:57 +00:00
|
|
|
go-version: '1.20'
|
2021-09-21 16:15:31 +00:00
|
|
|
|
2020-05-09 09:42:39 +00:00
|
|
|
- name: Lint
|
2022-04-13 11:09:48 +00:00
|
|
|
uses: golangci/golangci-lint-action@v3
|
2021-09-21 09:34:22 +00:00
|
|
|
with:
|
2023-04-06 08:57:10 +00:00
|
|
|
version: v1.52.2
|
2023-06-28 17:19:00 +00:00
|
|
|
|
|
|
|
dev:
|
|
|
|
name: Developer environment
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
|
|
|
|
|
|
|
- name: Set up Nix
|
|
|
|
uses: cachix/install-nix-action@4b933aa7ebcc94a6174cf1364864e957b4910265 # v21
|
|
|
|
with:
|
|
|
|
extra_nix_config: |
|
|
|
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
- name: Check
|
|
|
|
run: nix flake check --impure
|
|
|
|
|
|
|
|
- name: Dev shell
|
|
|
|
run: nix develop --impure
|
|
|
|
|
|
|
|
dependency-review:
|
|
|
|
name: Dependency review
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
|
|
|
|
|
|
|
- name: Dependency Review
|
|
|
|
uses: actions/dependency-review-action@1360a344ccb0ab6e9475edef90ad2f46bf8003b1 # v3.0.6
|