-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (44 loc) · 1.43 KB
/
unit-tests.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
47
48
49
50
51
52
53
54
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Unit Tests
runs-on: ubuntu-latest
steps:
# Check out code
- name: Checkout
uses: actions/checkout@v2
# Setup go 1.16
- name: Setup Go 1.16
uses: actions/setup-go@v2.1.3
with:
go-version: '^1.16.5'
# Set up Go pkg cache
- name: Cache Go Packages and controller-util Binaries
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
/home/runner/work/jsonnet-controller/jsonnet-controller/testbin
/home/runner/work/jsonnet-controller/jsonnet-controller/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Run linting
- name: Run Lint
run: make lint
# Run unit tests - this will also ensure code-generation is run
- name: Run Unit Tests
run: make test
# Update documentation
- name: Force pkg.go.dev to refresh main branch
run: curl "https://proxy.golang.org/github.com/pelotech/jsonnet-controller/@v/${GITHUB_REF##*/}.info"
if: ${{ github.ref == 'refs/heads/main' }}
- name: Force pkg.go.dev to refresh latest tag
run: curl https://proxy.golang.org/github.com/pelotech/jsonnet-controller/@v/${{ steps.version.outputs.tag }}.info
if: ${{ startsWith(github.ref, 'refs/tags/v') }}