-
Notifications
You must be signed in to change notification settings - Fork 26
46 lines (39 loc) · 943 Bytes
/
test.yaml
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
name: Test
on:
push:
branches:
- main
paths:
- 'pkg/**'
- '*.go'
- 'go.*'
- '.github/workflows/test.yaml'
pull_request:
paths:
- 'pkg/**'
- '*.go'
- 'go.*'
- '.github/workflows/test.yaml'
env:
GO_VERSION: "1.22"
jobs:
unit-tests:
name: 'Unit tests'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- id: go-cache-paths
run: |
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
# Cache go mod cache to speedup deps downloads
- uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-mod-
- name: 'Run unit tests'
run: |
make test