forked from hashicorp/terraform-provider-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (74 loc) · 2.82 KB
/
acctest-terraform-lint.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
name: Acceptance Test Linting
on:
push:
branches:
- master
- "release/**"
pull_request:
paths:
- .github/workflows/acctest-terraform-lint.yml
- aws/*_test.go
- scripts/validate-terraform.sh
- tools/go.mod
env:
GO_VERSION: "1.15"
GO111MODULE: on
jobs:
terrafmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd tools && go install github.com/katbyte/terrafmt
# - run: terrafmt diff ./aws --check --pattern '*_test.go' --fmtcompat
- run: |
find ./aws -type f -name '*_test.go' \
| sort -u \
| grep -v resource_aws_apigatewayv2_domain_name_test.go \
| grep -v resource_aws_ecs_capacity_provider_test.go \
| grep -v resource_aws_efs_file_system_test.go \
| grep -v resource_aws_kinesis_stream_test.go \
| grep -v resource_aws_kms_grant_test.go \
| grep -v resource_aws_quicksight_user_test.go \
| grep -v resource_aws_route_table_test.go \
| grep -v resource_aws_s3_bucket_object_test.go \
| grep -v resource_aws_sns_platform_application_test.go \
| xargs -I {} terrafmt diff --check --fmtcompat {}
validate-terraform:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
continue-on-error: true
timeout-minutes: 2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }}
- run: cd tools && go install github.com/katbyte/terrafmt
- run: cd tools && go install github.com/terraform-linters/tflint
- run: |
find ./aws -type f -name '*_test.go' \
| sort -u \
| grep -v resource_aws_apigatewayv2_domain_name_test.go \
| grep -v resource_aws_ecs_capacity_provider_test.go \
| grep -v resource_aws_efs_file_system_test.go \
| grep -v resource_aws_elasticache_cluster_test.go \
| grep -v resource_aws_kinesis_stream_test.go \
| grep -v resource_aws_kms_grant_test.go \
| grep -v resource_aws_lambda_permission_test.go \
| grep -v resource_aws_quicksight_user_test.go \
| grep -v resource_aws_route_table_test.go \
| grep -v resource_aws_s3_bucket_object_test.go \
| grep -v resource_aws_sns_platform_application_test.go \
| ./scripts/validate-terraform.sh