generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 50
110 lines (88 loc) · 2.56 KB
/
terraform_provider.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
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
name: Terraform Provider Checks
on:
pull_request:
push:
branches:
- main
paths-ignore:
- 'README.md'
jobs:
# ensure go.mod and go.sum are updated
depscheck:
name: Check Dependencies
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
cache: true
go-version-file: 'go.mod'
id: go
- name: Run 'go mod tidy' and check for differences
run: |
make depscheck
# ensure the code builds
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
cache: true
go-version-file: 'go.mod'
id: go
- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v .
# run unit tests and linter
test_and_lint:
name: Unit Test and Lint
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
cache: true
go-version-file: 'go.mod'
id: go
- name: Get dependencies
run: |
go install github.com/golangci/golangci-lint/cmd/[email protected]
go mod download
- name: Run unit tests and linter
run: |
make test-ci
- name: Upload Coverage Artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: Test Coverage
path: coverage.html
# ensure docs are generated
gencheck:
name: Check Generated Docs
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
cache: true
go-version-file: 'go.mod'
id: go
- name: Generate docs and check for differences
run: |
make gencheck