2019-12-06 11:22:07 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-06-29 03:46:41 +00:00
|
|
|
branches: [master]
|
2019-12-06 11:22:07 +00:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2022-11-03 17:16:10 +00:00
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-29 03:46:41 +00:00
|
|
|
|
2022-11-03 17:16:10 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- goos: js
|
|
|
|
goarch: wasm
|
|
|
|
- goos: aix
|
|
|
|
goarch: ppc64
|
|
|
|
|
|
|
|
steps:
|
2023-06-29 03:46:41 +00:00
|
|
|
- name: Checkout repository
|
2024-05-13 18:00:24 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-06-03 12:59:37 +00:00
|
|
|
|
2022-11-03 17:16:10 +00:00
|
|
|
- name: Set up Go
|
2024-05-02 17:26:29 +00:00
|
|
|
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
2022-11-03 17:16:10 +00:00
|
|
|
with:
|
2024-03-25 12:22:26 +00:00
|
|
|
go-version: "1.22"
|
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 }}
|
2023-06-29 03:46:41 +00:00
|
|
|
|
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]
|
2024-03-25 12:22:26 +00:00
|
|
|
go: ["1.20", "1.21", "1.22"]
|
2023-12-15 12:31:38 +00:00
|
|
|
tags: ["", "finder", "viper_bind_struct"]
|
2019-12-06 11:22:07 +00:00
|
|
|
|
|
|
|
steps:
|
2023-06-29 03:46:41 +00:00
|
|
|
- name: Checkout repository
|
2024-05-13 18:00:24 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-06-03 12:59:37 +00:00
|
|
|
|
2019-12-06 11:22:07 +00:00
|
|
|
- name: Set up Go
|
2024-05-02 17:26:29 +00:00
|
|
|
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
2019-12-06 11:22:07 +00:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
|
|
|
|
2021-09-21 16:15:31 +00:00
|
|
|
- name: Test
|
2023-10-07 19:35:21 +00:00
|
|
|
run: go test -race -v -tags '${{ matrix.tags }}' -shuffle=on ./...
|
2021-12-28 08:37:48 +00:00
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
- name: Test (without race detector)
|
2023-10-07 19:35:21 +00:00
|
|
|
run: go test -v -tags '${{ matrix.tags }}' -shuffle=on ./...
|
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
|
|
|
|
|
|
|
|
steps:
|
2023-06-29 03:46:41 +00:00
|
|
|
- name: Checkout repository
|
2024-05-13 18:00:24 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-06-03 12:59:37 +00:00
|
|
|
|
2021-09-21 16:15:31 +00:00
|
|
|
- name: Set up Go
|
2024-05-02 17:26:29 +00:00
|
|
|
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
|
2021-09-21 16:15:31 +00:00
|
|
|
with:
|
2024-02-15 11:03:46 +00:00
|
|
|
go-version: "1.22"
|
2021-09-21 16:15:31 +00:00
|
|
|
|
2020-05-09 09:42:39 +00:00
|
|
|
- name: Lint
|
2024-05-08 17:52:32 +00:00
|
|
|
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # v6.0.1
|
2021-09-21 09:34:22 +00:00
|
|
|
with:
|
2024-02-15 11:03:46 +00:00
|
|
|
version: v1.56.1
|
2023-06-28 17:19:00 +00:00
|
|
|
|
|
|
|
dev:
|
|
|
|
name: Developer environment
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2024-05-13 18:00:24 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-06-28 17:19:00 +00:00
|
|
|
|
|
|
|
- name: Set up Nix
|
2024-03-11 17:10:24 +00:00
|
|
|
uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
|
2023-06-28 17:19:00 +00:00
|
|
|
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
|
2024-05-13 18:00:24 +00:00
|
|
|
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
|
2023-06-28 17:19:00 +00:00
|
|
|
|
|
|
|
- name: Dependency Review
|
2024-04-30 17:42:21 +00:00
|
|
|
uses: actions/dependency-review-action@0c155c5e8556a497adf53f2c18edabf945ed8e70 # v4.3.2
|