-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (80 loc) · 2.48 KB
/
_test-tf.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
83
84
85
86
87
88
89
90
on:
pull_request:
branches:
- main
paths:
- '.github/workflows/_test-tf.yaml'
- '.github/workflows/tf-*.yaml'
- 'tests/terraform/**'
jobs:
test_tf_feature:
uses: ./.github/workflows/tf-feature.yaml
with:
environment: sandbox
tf_workspace: test/slash/replacement
test_tf_outputs:
needs: test_tf_feature
runs-on: ubuntu-latest
steps:
- name: Show Terraform Outputs
run: echo "${{ needs.test_tf_feature.outputs.tf_outputs }}"
test_tf_outputs_decode_random_pet:
needs: test_tf_feature
runs-on: ubuntu-latest
steps:
- name: Show random_pet output resource
run: echo "${{ fromJson(needs.test_tf_feature.outputs.tf_outputs).random_pet }}"
test_tf_plan:
uses: ./.github/workflows/tf-plan.yaml
with:
environment: sandbox
test_tf_apply:
uses: ./.github/workflows/tf-apply.yaml
with:
environment: sandbox
tf_pre_run: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip -qq awscliv2.zip && ./aws/install
test_tf_cleanup:
needs: test_tf_apply
uses: ./.github/workflows/tf-cleanup.yaml
with:
environment: sandbox
tf_workspace: test/slash/replacement
test_tf_plan_no_environment:
uses: ./.github/workflows/tf-plan.yaml
with:
aws_account_id: 911453050078
aws_region: eu-central-1
aws_role_name: cicd-iac
tf_dir: tests/terraform/s3
tf_backend_configs: |
bucket=tf-state-911453050078
key=sandbox1.tfstate
workspace_key_prefix=github-workflows
tf_var_files: tests/terraform/s3/environment/sandbox.tfvars
test_upload_artifact:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/upload-artifact@v4
with:
name: docker-artifacts
path: tests/docker-artifacts/artifact-sample.txt
test_tf_artifact:
needs: test_upload_artifact
uses: ./.github/workflows/tf-plan.yaml
with:
environment: sandbox
tf_dir: tests/terraform/artifact
gh_artifact_name: docker-artifacts
gh_artifact_path: tests/terraform/artifact/
tf_vars: |
file_path="artifact-sample.txt"
test_tf_artifact_all:
needs: test_upload_artifact
uses: ./.github/workflows/tf-plan.yaml
with:
environment: sandbox
tf_dir: tests/terraform/artifact
gh_artifact_path: tests/terraform/artifact/
tf_vars: |
file_path="docker-artifacts/artifact-sample.txt"