...
1name: CI
2
3on:
4 push:
5 branches: [master]
6 pull_request:
7
8jobs:
9 build:
10 name: Build
11 runs-on: ubuntu-latest
12
13 strategy:
14 fail-fast: false
15 matrix:
16 include:
17 - goos: js
18 goarch: wasm
19 - goos: aix
20 goarch: ppc64
21
22 steps:
23 - name: Checkout repository
24 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25
26 - name: Set up Go
27 uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
28 with:
29 go-version: "1.21"
30
31 - name: Build
32 run: go build .
33 env:
34 GOOS: ${{ matrix.goos }}
35 GOARCH: ${{ matrix.goarch }}
36
37 test:
38 name: Test
39 runs-on: ${{ matrix.os }}
40
41 strategy:
42 # Fail fast is disabled because there are Go version specific features and tests
43 # that should be able to fail independently.
44 fail-fast: false
45 matrix:
46 os: [ubuntu-latest, macos-latest, windows-latest]
47 go: ["1.19", "1.20", "1.21"]
48 tags: ["", "finder", "viper_bind_struct"]
49
50 steps:
51 - name: Checkout repository
52 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
53
54 - name: Set up Go
55 uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
56 with:
57 go-version: ${{ matrix.go }}
58
59 - name: Test
60 run: go test -race -v -tags '${{ matrix.tags }}' -shuffle=on ./...
61 if: runner.os != 'Windows'
62
63 - name: Test (without race detector)
64 run: go test -v -tags '${{ matrix.tags }}' -shuffle=on ./...
65 if: runner.os == 'Windows'
66
67 lint:
68 name: Lint
69 runs-on: ubuntu-latest
70
71 steps:
72 - name: Checkout repository
73 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
74
75 - name: Set up Go
76 uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
77 with:
78 go-version: "1.21"
79
80 - name: Lint
81 uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
82 with:
83 version: v1.54.2
84
85 dev:
86 name: Developer environment
87 runs-on: ubuntu-latest
88
89 steps:
90 - name: Checkout repository
91 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
92
93 - name: Set up Nix
94 uses: cachix/install-nix-action@7ac1ec25491415c381d9b62f0657c7a028df52a7 # v24
95 with:
96 extra_nix_config: |
97 access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
98
99 - name: Check
100 run: nix flake check --impure
101
102 - name: Dev shell
103 run: nix develop --impure
104
105 dependency-review:
106 name: Dependency review
107 runs-on: ubuntu-latest
108 if: github.event_name == 'pull_request'
109
110 steps:
111 - name: Checkout repository
112 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
113
114 - name: Dependency Review
115 uses: actions/dependency-review-action@01bc87099ba56df1e897b6874784491ea6309bc4 # v3.1.4
View as plain text