-
Notifications
You must be signed in to change notification settings - Fork 235
54 lines (50 loc) · 1.33 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
name: unit tests
on:
pull_request: {}
push:
branches:
- main
- master
jobs:
lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make golangci-lint # Using the makefile to have the same command in CI and locally
terraform_fmt:
name: terraform fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- name: terraform fmt
run: terraform fmt -recursive -check || (echo "Terraform files aren't formatted. Run 'terraform fmt -recursive && go generate'"; exit 1;)
docs:
name: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: generate docs
run: |
go generate
gitstatus="$(git status --porcelain)"
if [ -n "$gitstatus" ]; then
echo "$gitstatus"
echo 'docs are out of sync, run "go generate"'
exit 1
fi
- run: make linkcheck
unit:
name: unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- uses: hashicorp/setup-terraform@v3
- run: go test ./...