Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub pr comment refactor #179

Merged
merged 18 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/github_sucks.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Everytime I need to generate a push or synchronise event I will touch this file.
This is usually because GitHub Actions has broken in some way.

4 changes: 2 additions & 2 deletions .github/workflows/pull_request_review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
uses: ./terraform-plan
with:
label: pull_request_review
path: tests/apply/changes
path: tests/workflows/pull_request_review

- name: Apply
uses: ./terraform-apply
id: output
with:
label: pull_request_review
path: tests/apply/changes
path: tests/workflows/pull_request_review

- name: Verify outputs
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_target.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
uses: ./terraform-plan
with:
label: pull_request_target
path: tests/apply/changes
path: tests/workflows/pull_request_target

- name: Apply
uses: ./terraform-apply
id: output
with:
label: pull_request_target
path: tests/apply/changes
path: tests/workflows/pull_request_target

- name: Verify outputs
run: |
Expand Down
121 changes: 67 additions & 54 deletions .github/workflows/test-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: ./terraform-apply
id: output
with:
path: tests/remote-state/test-bucket_12
path: tests/workflows/test-apply/remote
auto_approve: true

- name: Verify outputs
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
id: apply
continue-on-error: true
with:
path: tests/remote-state/test-bucket_12
path: tests/workflows/test-apply/remote
auto_approve: true

- name: Check failed to apply
Expand Down Expand Up @@ -89,16 +89,16 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
label: Apply Error
path: tests/apply/apply-error
label: test-apply apply_apply_error
path: tests/workflows/test-apply/apply-error

- name: Apply
uses: ./terraform-apply
id: apply
continue-on-error: true
with:
label: Apply Error
path: tests/apply/apply-error
label: test-apply apply_apply_error
path: tests/workflows/test-apply/apply-error

- name: Check failed to apply
run: |
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
id: apply
continue-on-error: true
with:
path: tests/apply/changes
path: tests/workflows/test-apply/changes

- name: Check failed to apply
run: |
Expand All @@ -160,13 +160,15 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
path: tests/apply/changes
label: test-apply apply
path: tests/workflows/test-apply/changes

- name: Apply
uses: ./terraform-apply
id: first-apply
with:
path: tests/apply/changes
label: test-apply apply
path: tests/workflows/test-apply/changes

- name: Verify outputs
run: |
Expand All @@ -189,7 +191,8 @@ jobs:
uses: ./terraform-apply
id: second-apply
with:
path: tests/apply/changes
label: test-apply apply
path: tests/workflows/test-apply/changes

- name: Verify outputs
run: |
Expand Down Expand Up @@ -220,7 +223,8 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
path: tests/apply/vars
label: test-apply apply_variables
path: tests/workflows/test-apply/vars
variables: |
my_var="hello"
complex_input=[
Expand All @@ -235,13 +239,14 @@ jobs:
protocol = "tcp"
},
]
var_file: tests/apply/test.tfvars
var_file: tests/workflows/test-apply/test.tfvars

- name: Apply
uses: ./terraform-apply
id: output
with:
path: tests/apply/vars
label: test-apply apply_variables
path: tests/workflows/test-apply/vars
variables: |
my_var="hello"
complex_input=[
Expand All @@ -256,7 +261,7 @@ jobs:
protocol = "tcp"
},
]
var_file: tests/apply/test.tfvars
var_file: tests/workflows/test-apply/test.tfvars

- name: Verify outputs
run: |
Expand Down Expand Up @@ -304,15 +309,17 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
path: tests/apply/backend_config_12
backend_config_file: tests/apply/backend_config_12/backend_config
label: test-apply backend_config_12 backend_config_file
path: tests/workflows/test-apply/backend_config_12
backend_config_file: tests/workflows/test-apply/backend_config_12/backend_config

- name: Apply
uses: ./terraform-apply
id: backend_config_file_12
with:
path: tests/apply/backend_config_12
backend_config_file: tests/apply/backend_config_12/backend_config
label: test-apply backend_config_12 backend_config_file
path: tests/workflows/test-apply/backend_config_12
backend_config_file: tests/workflows/test-apply/backend_config_12/backend_config

- name: Verify outputs
run: |
Expand All @@ -334,7 +341,8 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
path: tests/apply/backend_config_12
label: test-apply backend_config_12 backend_config
path: tests/workflows/test-apply/backend_config_12
backend_config: |
bucket=terraform-github-actions
key=backend_config
Expand All @@ -344,7 +352,8 @@ jobs:
uses: ./terraform-apply
id: backend_config_12
with:
path: tests/apply/backend_config_12
label: test-apply backend_config_12 backend_config
path: tests/workflows/test-apply/backend_config_12
backend_config: |
bucket=terraform-github-actions
key=backend_config
Expand Down Expand Up @@ -381,15 +390,17 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
path: tests/apply/backend_config_13
backend_config_file: tests/apply/backend_config_13/backend_config
label: test-apply backend_config_12 backend_config_file
path: tests/workflows/test-apply/backend_config_13
backend_config_file: tests/workflows/test-apply/backend_config_13/backend_config

- name: Apply
uses: ./terraform-apply
id: backend_config_file_13
with:
path: tests/apply/backend_config_13
backend_config_file: tests/apply/backend_config_13/backend_config
label: test-apply backend_config_12 backend_config_file
path: tests/workflows/test-apply/backend_config_13
backend_config_file: tests/workflows/test-apply/backend_config_13/backend_config

- name: Verify outputs
run: |
Expand All @@ -411,7 +422,8 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
path: tests/apply/backend_config_13
label: test-apply backend_config_12 backend_config
path: tests/workflows/test-apply/backend_config_13
backend_config: |
bucket=terraform-github-actions
key=backend_config_13
Expand All @@ -421,7 +433,8 @@ jobs:
uses: ./terraform-apply
id: backend_config_13
with:
path: tests/apply/backend_config_13
label: test-apply backend_config_12 backend_config
path: tests/workflows/test-apply/backend_config_13
backend_config: |
bucket=terraform-github-actions
key=backend_config_13
Expand Down Expand Up @@ -456,19 +469,19 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
path: tests/apply/vars
label: TestLabel
path: tests/workflows/test-apply/vars
label: test-apply apply_label
variables: my_var="world"
var_file: tests/apply/test.tfvars
var_file: tests/workflows/test-apply/test.tfvars

- name: Apply
uses: ./terraform-apply
id: output
with:
path: tests/apply/vars
label: TestLabel
path: tests/workflows/test-apply/vars
label: test-apply apply_label
variables: my_var="world"
var_file: tests/apply/test.tfvars
var_file: tests/workflows/test-apply/test.tfvars

- name: Verify outputs
run: |
Expand Down Expand Up @@ -502,7 +515,7 @@ jobs:
uses: ./terraform-apply
id: output
with:
path: tests/remote-state/test-bucket_12
path: tests/workflows/test-apply/remote

- name: Verify outputs
run: |
Expand Down Expand Up @@ -536,7 +549,7 @@ jobs:
id: apply
continue-on-error: true
with:
path: tests/apply/no_plan
path: tests/workflows/test-apply/no_plan

- name: Check failed to apply
run: |
Expand Down Expand Up @@ -567,15 +580,15 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
label: User PAT
path: tests/apply/changes
label: test-apply apply_user_token
path: tests/workflows/test-apply/changes

- name: Apply
uses: ./terraform-apply
id: output
with:
label: User PAT
path: tests/apply/changes
label: test-apply apply_user_token
path: tests/workflows/test-apply/changes

- name: Verify outputs
run: |
Expand Down Expand Up @@ -606,17 +619,17 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
path: tests/apply/vars
path: tests/workflows/test-apply/deprecated_var
var: my_var=hello
var_file: tests/apply/test.tfvars
var_file: tests/workflows/test-apply/test.tfvars

- name: Apply
uses: ./terraform-apply
id: output
with:
path: tests/apply/vars
path: tests/workflows/test-apply/deprecated_var
var: my_var=hello
var_file: tests/apply/test.tfvars
var_file: tests/workflows/test-apply/test.tfvars

- name: Verify outputs
run: |
Expand Down Expand Up @@ -645,30 +658,30 @@ jobs:
- name: Plan 1
uses: ./terraform-plan
with:
label: Refresh 1
path: tests/apply/refresh_15
label: test-apply apply_refresh 1
path: tests/workflows/test-apply/refresh_15
variables: len=10

- name: Apply 1
uses: ./terraform-apply
with:
label: Refresh 1
path: tests/apply/refresh_15
label: test-apply apply_refresh 1
path: tests/workflows/test-apply/refresh_15
variables: len=10

- name: Plan 2
uses: ./terraform-plan
with:
label: Refresh 2
path: tests/apply/refresh_15
label: test-apply apply_refresh 2
path: tests/workflows/test-apply/refresh_15
variables: len=20

- name: Apply 2
uses: ./terraform-apply
id: output
with:
label: Refresh 2
path: tests/apply/refresh_15
label: test-apply apply_refresh 2
path: tests/workflows/test-apply/refresh_15
variables: len=20

apply_with_pre_run:
Expand All @@ -686,15 +699,15 @@ jobs:
- name: Plan
uses: ./terraform-plan
with:
label: pre-run
path: tests/apply/changes
label: test-apply apply_with_pre_run
path: tests/workflows/test-apply/changes

- name: Apply
uses: ./terraform-apply
id: output
with:
label: pre-run
path: tests/apply/changes
label: test-apply apply_with_pre_run
path: tests/workflows/test-apply/changes

- name: Verify outputs
run: |
Expand Down
Loading