generated from deploymenttheory/Template
-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (54 loc) · 1.35 KB
/
unit-tests.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
53
54
55
56
57
58
59
60
name: unit tests
on:
push:
branches: [ '*' ]
paths-ignore:
- '**/*.yml'
- '**/*.md'
- '**/*.yml'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
- 'docs/**'
- '.github/ISSUE_TEMPLATE/**'
- 'examples/**'
- 'website/**'
- '.vscode/**'
- '.idea/**'
- '**/*.txt'
- '**/*.png'
- '**/*.jpg'
- '**/*.svg'
- '.golangci.yml'
- 'Makefile'
- 'scripts/**'
- '.dockerignore'
- 'dockerfile'
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5.1.0
with:
go-version-file: 'go.mod'
cache: true
go-version: stable
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
# TODO - setup codecov server side
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4.5.0
# with:
# file: ./coverage.txt
# flags: unittests
# fail_ci_if_error: true
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}