-
Notifications
You must be signed in to change notification settings - Fork 2
/
workflow.yml
53 lines (44 loc) · 1.28 KB
/
workflow.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
---
name: terratest
on:
workflow_call:
inputs:
test:
description: name of the test to run e.g. azure
type: string
required: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false # disable wrap of subsequent calls - like debug mode
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
check-latest: true
- name: Prepare Test Setup
run: cat examples/main.tf | sed 's/\<source\>.*/source = "..\/"/g' > tests/main.tf
working-directory: .
- name: Checkout Github Action
uses: actions/checkout@v3
with:
repository: telekom-mms/terratest-action
ref: main
path: ./terratest-action
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Log in with Azure
uses: azure/login@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
if: ${{ inputs.test }} == azure
- name: Run Test for ${{ matrix.example }} Setup
uses: ./terratest-action
with:
test: ${{ inputs.test }}