viper/.github/workflows/ci.yaml

116 lines
3.0 KiB
YAML
Raw Normal View History

2019-12-06 14:22:07 +03:00
name: CI
on:
push:
branches: [master]
2019-12-06 14:22:07 +03:00
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: js
goarch: wasm
- goos: aix
goarch: ppc64
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: "1.21"
- name: Build
run: go build .
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
test:
name: Test
runs-on: ${{ matrix.os }}
2019-12-06 14:22:07 +03:00
strategy:
# 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:
os: [ubuntu-latest, macos-latest, windows-latest]
go: ["1.19", "1.20", "1.21", "1.22"]
tags: ["", "finder", "viper_bind_struct"]
2019-12-06 14:22:07 +03:00
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2019-12-06 14:22:07 +03:00
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
2019-12-06 14:22:07 +03:00
with:
go-version: ${{ matrix.go }}
- 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'
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: "1.22"
2020-05-09 12:42:39 +03:00
- name: Lint
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
with:
version: v1.56.1
dev:
name: Developer environment
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Nix
uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Dependency Review
uses: actions/dependency-review-action@80f10bf419f34980065523f5efca7ebed17576aa # v4.1.0