-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.18 KB
/
nix.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Lint and build with the Nix flake.
name: Nix Build
on:
push:
branches:
- main
- "test-*"
tags:
- "v*.*.*"
pull_request:
branches:
- main
jobs:
check_nix:
name: Linting
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v18
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: GolangCI Lint
run: |
nix develop --command \
golangci-lint --version
nix develop --command \
golangci-lint run --verbose --out-format=github-actions
build_and_test_nix:
name: Test and build
needs: check_nix
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v18
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Test
run: |
nix develop --command \
go test -v -race ./...
- name: Build
run: nix build