-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (43 loc) · 1.11 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
name: Test
on:
workflow_call:
jobs:
lint-validate:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- name: Init
run: terraform init
- name: Validate
run: terraform validate
- name: tfsec
uses: aquasecurity/tfsec-action@v1.0.3
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: Install tflint plugins
run: tflint --init
- name: Lint Terraform files
run: tflint
terratest:
runs-on: ubuntu-20.04
strategy:
matrix:
test: [TestGitHubActionsOidcModuleGoodInput, TestGitHubActionsOidcModuleBadInput]
defaults:
run:
working-directory: tests
services:
localstack:
image: localstack/localstack
ports:
- 4566:4566
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- uses: actions/setup-go@v5
- run: cp mocks/mock_provider.tf ../
- name: terratest
run: go test -v -run ${{ matrix.test }}