-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (73 loc) · 2.32 KB
/
test.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
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
---
name: Test
on: # yamllint disable-line rule:truthy
pull_request:
branches: [main]
permissions:
contents: write
jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: hashicorp/setup-terraform@v3
- name: Init
run: terraform init --upgrade --backend=false
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_options: --no-verify
test:
runs-on: ubuntu-latest
needs: init
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: tests/go.mod
cache-dependency-path: tests/go.sum
- name: Test
working-directory: tests
run: go test
tflint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: terraform-linters/setup-tflint@v4
- run: tflint --version
- run: tflint --init
env:
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
GITHUB_TOKEN: ${{ github.token }}
- run: tflint -f compact
tfsec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aquasecurity/[email protected]
with:
github_token: ${{ github.token }}
docs:
runs-on: ubuntu-latest
needs: init
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- uses: terraform-docs/[email protected]
with:
git-push: true
jsonlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run JSON Lint
# yamllint disable-line rule:line-length
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/json-lint/master/pipeline.sh)
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3