Skip to content

Commit 0afc709

Browse files
committed
ci: Add fmt and gen linting
1 parent 90194db commit 0afc709

File tree

1 file changed

+72
-39
lines changed

1 file changed

+72
-39
lines changed

.github/workflows/test.yml

Lines changed: 72 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,33 @@ name: Tests
55
on:
66
pull_request:
77
paths-ignore:
8-
- 'README.md'
8+
- "README.md"
99
push:
1010
paths-ignore:
11-
- 'README.md'
11+
- "README.md"
1212

1313
jobs:
1414
build:
1515
name: Build
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 5
1818
steps:
19+
- name: Set up Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: "1.20"
23+
id: go
1924

20-
- name: Set up Go
21-
uses: actions/setup-go@v3
22-
with:
23-
go-version: '1.17'
24-
id: go
25+
- name: Check out code into the Go module directory
26+
uses: actions/checkout@v3
2527

26-
- name: Check out code into the Go module directory
27-
uses: actions/checkout@v3
28+
- name: Get dependencies
29+
run: |
30+
go mod download
2831
29-
- name: Get dependencies
30-
run: |
31-
go mod download
32-
33-
- name: Build
34-
run: |
35-
go build -v .
32+
- name: Build
33+
run: |
34+
go build -v .
3635
3736
# run acceptance tests in a matrix with Terraform core versions
3837
test:
@@ -44,31 +43,65 @@ jobs:
4443
fail-fast: false
4544
matrix:
4645
terraform:
47-
- '1.0.*'
48-
- '1.1.*'
46+
- "1.0.*"
47+
- "1.1.*"
48+
- "1.2.*"
49+
- "1.3.*"
50+
steps:
51+
- name: Set up Go
52+
uses: actions/setup-go@v3
53+
with:
54+
go-version: "1.20"
55+
id: go
56+
57+
- uses: hashicorp/setup-terraform@v2
58+
with:
59+
terraform_version: ${{ matrix.terraform }}
60+
terraform_wrapper: false
61+
62+
- name: Check out code into the Go module directory
63+
uses: actions/checkout@v3
64+
65+
- name: Get dependencies
66+
run: |
67+
go mod download
68+
69+
- name: TF acceptance tests
70+
timeout-minutes: 10
71+
env:
72+
TF_ACC: "1"
73+
run: |
74+
go test -v -cover ./provider/
75+
76+
lint:
77+
name: Lint
78+
runs-on: ubuntu-latest
79+
timeout-minutes: 5
4980
steps:
81+
- name: Set up Go
82+
uses: actions/setup-go@v3
83+
with:
84+
go-version: "1.20"
85+
id: go
86+
87+
- uses: hashicorp/setup-terraform@v2
88+
with:
89+
terraform_version: "1.3.*"
90+
terraform_wrapper: false
5091

51-
- name: Set up Go
52-
uses: actions/setup-go@v3
53-
with:
54-
go-version: '1.17'
55-
id: go
92+
- name: Check out code into the Go module directory
93+
uses: actions/checkout@v3
5694

57-
- uses: hashicorp/setup-terraform@v2
58-
with:
59-
terraform_version: ${{ matrix.terraform }}
60-
terraform_wrapper: false
95+
- name: Get dependencies
96+
run: |
97+
go mod download
6198
62-
- name: Check out code into the Go module directory
63-
uses: actions/checkout@v3
99+
- name: Lint fmt
100+
run: |
101+
make fmt
102+
git diff --exit-code
64103
65-
- name: Get dependencies
66-
run: |
67-
go mod download
68-
69-
- name: TF acceptance tests
70-
timeout-minutes: 10
71-
env:
72-
TF_ACC: "1"
73-
run: |
74-
go test -v -cover ./provider/
104+
- name: Lint gen
105+
run: |
106+
make gen
107+
git diff --exit-code

0 commit comments

Comments
 (0)