-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (93 loc) · 2.5 KB
/
codeChecks.yml
File metadata and controls
114 lines (93 loc) · 2.5 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
name: CodeChecks
on:
push:
paths:
- ".github/workflows/codeChecks.yml"
- ".goreleaser.yaml"
- ".testcoverage.yml"
- "devenv.*"
- "cmd/**"
- "internal/**"
- "pkg/**"
- "*.go"
- "go.*"
jobs:
go_tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
go-version: ["1.25"]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: go get .
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test -v ./...
- name: Check for vulnerabilities
uses: golang/govulncheck-action@v1
with:
go-version-input: ${{ matrix.go-version }}
go-package: ./...
work-dir: .
devenv_test:
needs: go_tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v16
with:
name: devenv
- name: Install devenv.sh
run: nix profile add nixpkgs#devenv
- name: Build the devenv shell and run any pre-commit hooks
run: devenv test
timeout-minutes: 15
go_test_coverage_check:
needs: go_tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: generate test coverage
run: go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
- name: check test coverage
uses: vladopajic/go-test-coverage@v2
with:
config: ./.testcoverage.yml
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
git-branch: badges
goreleaser_test:
needs: devenv_test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Run GoReleaser test
uses: goreleaser/goreleaser-action@v6
with:
version: "~> 2"
args: release --snapshot --clean
workdir: .