2019-12-06 14:22:07 +03:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-06-29 06:46:41 +03:00
|
|
|
branches: [master]
|
2019-12-06 14:22:07 +03:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2022-11-03 20:16:10 +03:00
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-29 06:46:41 +03:00
|
|
|
|
2022-11-03 20:16:10 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- goos: js
|
|
|
|
goarch: wasm
|
|
|
|
- goos: aix
|
|
|
|
goarch: ppc64
|
|
|
|
|
|
|
|
steps:
|
2023-06-29 06:46:41 +03:00
|
|
|
- name: Checkout repository
|
2023-10-17 20:20:04 +03:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-06-03 15:59:37 +03:00
|
|
|
|
2022-11-03 20:16:10 +03:00
|
|
|
- name: Set up Go
|
2023-12-06 20:05:38 +03:00
|
|
|
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
|
2022-11-03 20:16:10 +03:00
|
|
|
with:
|
2023-12-15 15:31:38 +03:00
|
|
|
go-version: "1.21"
|
2022-11-03 20:16:10 +03:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: go build .
|
|
|
|
env:
|
|
|
|
GOOS: ${{ matrix.goos }}
|
|
|
|
GOARCH: ${{ matrix.goarch }}
|
|
|
|
|
2021-09-21 19:15:31 +03:00
|
|
|
test:
|
|
|
|
name: Test
|
2020-09-06 00:53:06 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-06-29 06:46:41 +03:00
|
|
|
|
2019-12-06 14:22:07 +03:00
|
|
|
strategy:
|
2021-09-21 12:25:18 +03: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 14:22:07 +03:00
|
|
|
matrix:
|
2021-09-21 12:26:55 +03:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2023-12-15 15:31:38 +03:00
|
|
|
go: ["1.19", "1.20", "1.21"]
|
|
|
|
tags: ["", "finder", "viper_bind_struct"]
|
2019-12-06 14:22:07 +03:00
|
|
|
|
|
|
|
steps:
|
2023-06-29 06:46:41 +03:00
|
|
|
- name: Checkout repository
|
2023-10-17 20:20:04 +03:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-06-03 15:59:37 +03:00
|
|
|
|
2019-12-06 14:22:07 +03:00
|
|
|
- name: Set up Go
|
2023-12-06 20:05:38 +03:00
|
|
|
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
|
2019-12-06 14:22:07 +03:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
|
|
|
|
2021-09-21 19:15:31 +03:00
|
|
|
- name: Test
|
2023-10-07 22:35:21 +03:00
|
|
|
run: go test -race -v -tags '${{ matrix.tags }}' -shuffle=on ./...
|
2021-12-28 11:37:48 +03:00
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
- name: Test (without race detector)
|
2023-10-07 22:35:21 +03:00
|
|
|
run: go test -v -tags '${{ matrix.tags }}' -shuffle=on ./...
|
2021-12-28 11:37:48 +03:00
|
|
|
if: runner.os == 'Windows'
|
2021-09-21 19:15:31 +03:00
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-06-29 06:46:41 +03:00
|
|
|
- name: Checkout repository
|
2023-10-17 20:20:04 +03:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-06-03 15:59:37 +03:00
|
|
|
|
2021-09-21 19:15:31 +03:00
|
|
|
- name: Set up Go
|
2023-12-06 20:05:38 +03:00
|
|
|
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
|
2021-09-21 19:15:31 +03:00
|
|
|
with:
|
2023-12-15 15:31:38 +03:00
|
|
|
go-version: "1.21"
|
2021-09-21 19:15:31 +03:00
|
|
|
|
2020-05-09 12:42:39 +03:00
|
|
|
- name: Lint
|
2023-08-15 20:57:06 +03:00
|
|
|
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
|
2021-09-21 12:34:22 +03:00
|
|
|
with:
|
2023-09-08 16:19:49 +03:00
|
|
|
version: v1.54.2
|
2023-06-28 20:19:00 +03:00
|
|
|
|
|
|
|
dev:
|
|
|
|
name: Developer environment
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-10-17 20:20:04 +03:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-06-28 20:19:00 +03:00
|
|
|
|
|
|
|
- name: Set up Nix
|
2023-11-29 17:33:47 +03:00
|
|
|
uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24
|
2023-06-28 20:19:00 +03: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
|
2023-10-17 20:20:04 +03:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-06-28 20:19:00 +03:00
|
|
|
|
|
|
|
- name: Dependency Review
|
2024-01-04 20:11:30 +03:00
|
|
|
uses: actions/dependency-review-action@c74b580d73376b7750d3d2a50bfb8adc2c937507 # v3.1.5
|