-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (109 loc) · 2.92 KB
/
codeChecks.yml
File metadata and controls
120 lines (109 loc) · 2.92 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
115
116
117
118
119
120
---
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: .
# # WARN this action will install devenv 2.x.x while
# # the repo still uses 1.11.1. Disabling it until devenv is upgraded
# 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 }}
# nix_path: nixpkgs=channel:nixos-25.11
#
# - 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
# env:
# JWTINFO_TEST_AUTH0: ${{ secrets.JWTINFO_TEST_AUTH0 }}
# 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
continue-on-error: ${{ github.ref_name != 'main' }}
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: .