Skip to content

Commit 267eec5

Browse files
authored
Support plan-diff (#77)
* Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Update outputs.tf * Update plat-ue2-sandbox.yaml * Update atmos.yaml * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Support plan-diff * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Added A/B testings * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag * Plan diff support skip init flag
1 parent f514d5b commit 267eec5

32 files changed

+1258
-53
lines changed

.github/workflows/test-atmos-pro-enabled.yml renamed to .github/workflows/test-atmos_pro.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
name: "Test - Atmos Pro Enabled"
1+
name: "Atmos Pro Integration Tests"
22

33
on:
4-
workflow_dispatch: {}
5-
6-
pull_request:
7-
types: [opened, synchronize, reopened]
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: "The fully-formed ref of the branch or tag that triggered the workflow run"
8+
required: false
9+
type: string
10+
sha:
11+
description: "The sha of the commit that triggered the workflow run"
12+
required: false
13+
type: string
814

915
env:
1016
AWS_REGION: us-east-2
@@ -29,9 +35,10 @@ jobs:
2935
- name: Checkout
3036
uses: actions/checkout@v4
3137
with:
32-
ref: ${{ github.event.pull_request.head.ref }}
38+
ref: ${{ inputs.ref }}
3339

3440
- name: Setup Atmos Test Config
41+
id: env
3542
shell: bash
3643
run: |
3744
mkdir -p ${{ runner.temp }}
@@ -44,18 +51,23 @@ jobs:
4451
sed -i -e 's#__PLAN_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
4552
sed -i -e 's#__APPLY_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
4653
54+
echo "seed=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${{ matrix.platform }}" >> $GITHUB_OUTPUT
55+
4756
cat ${{ runner.temp }}/atmos.yaml
4857
4958
- name: Plan Atmos Component
50-
uses: cloudposse/github-action-atmos-terraform-plan@v4
59+
uses: cloudposse/github-action-atmos-terraform-plan@v5
5160
with:
5261
component: "foobar-atmos-pro"
5362
stack: "plat-ue2-sandbox"
5463
atmos-config-path: ${{ runner.temp }}
64+
sha: ${{ inputs.sha }}
65+
env:
66+
TF_VAR_seed: ${{ steps.env.outputs.seed }}
5567

5668
- uses: actions/checkout@v4
5769
with:
58-
ref: ${{ github.event.pull_request.head.ref }}
70+
ref: ${{ inputs.ref }}
5971

6072
- name: Wait 15 sec to wait s3 bucket would be consistent (read after write consistency)
6173
shell: bash
@@ -69,8 +81,10 @@ jobs:
6981
component: "foobar-atmos-pro"
7082
stack: "plat-ue2-sandbox"
7183
atmos-config-path: ${{ runner.temp }}
72-
atmos-version: ">= 1.174.0"
73-
84+
sha: ${{ inputs.sha }}
85+
env:
86+
TF_VAR_seed: ${{ steps.env.outputs.seed }}
87+
7488
outputs:
7589
result: ${{ steps.current.outputs.status }}
7690

.github/workflows/integration-tests.yml renamed to .github/workflows/test-basic.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
name: "Integration Tests"
22

33
on:
4-
workflow_dispatch: {}
5-
6-
pull_request:
7-
types: [opened, synchronize, reopened]
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: "The fully-formed ref of the branch or tag that triggered the workflow run"
8+
required: false
9+
type: string
10+
sha:
11+
description: "The sha of the commit that triggered the workflow run"
12+
required: false
13+
type: string
814

915
env:
1016
AWS_REGION: us-east-2
@@ -26,9 +32,10 @@ jobs:
2632
steps:
2733
- uses: actions/checkout@v4
2834
with:
29-
ref: ${{ github.event.pull_request.head.ref }}
35+
ref: ${{ inputs.ref }}
3036

3137
- shell: bash
38+
id: env
3239
run: |
3340
mkdir -p ${{ runner.temp }}
3441
cp ./tests/${{ matrix.platform }}/atmos.yaml ${{ runner.temp }}/atmos.yaml
@@ -41,21 +48,28 @@ jobs:
4148
sed -i -e 's#__PLAN_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
4249
sed -i -e 's#__APPLY_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
4350
51+
echo "seed=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${{ matrix.platform }}" >> $GITHUB_OUTPUT
52+
4453
- name: Plan Atmos Component
4554
uses: cloudposse/github-action-atmos-terraform-plan@v4
4655
with:
4756
component: "foobar"
4857
stack: "plat-ue2-sandbox"
4958
atmos-config-path: ${{ runner.temp }}
59+
debug: true
60+
sha: ${{ inputs.sha }}
61+
env:
62+
TF_VAR_seed: ${{ steps.env.outputs.seed }}
63+
5064

5165
- uses: actions/checkout@v4
5266
with:
53-
ref: ${{ github.event.pull_request.head.ref }}
67+
ref: ${{ inputs.ref }}
5468

55-
- name: Wait 15 sec to wait s3 bucket would be consistent (read after write consistency)
69+
- name: Wait 60 sec to wait s3 bucket would be consistent (read after write consistency)
5670
shell: bash
5771
run: |
58-
sleep 15;
72+
sleep 60;
5973
6074
- name: Apply Atmos Component
6175
uses: ./
@@ -64,3 +78,7 @@ jobs:
6478
stack: "plat-ue2-sandbox"
6579
atmos-config-path: ${{ runner.temp }}
6680
debug: true
81+
sha: ${{ inputs.sha }}
82+
env:
83+
TF_VAR_seed: ${{ steps.env.outputs.seed }}
84+

.github/workflows/test-plan_diff.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: "Integration Tests - Plan diff"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: "The fully-formed ref of the branch or tag that triggered the workflow run"
8+
required: false
9+
type: string
10+
sha:
11+
description: "The sha of the commit that triggered the workflow run"
12+
required: false
13+
type: string
14+
15+
env:
16+
AWS_REGION: us-east-2
17+
18+
19+
# Permissions required for assuming AWS identity
20+
permissions:
21+
id-token: write
22+
contents: read
23+
24+
jobs:
25+
test:
26+
runs-on: ubuntu-latest
27+
continue-on-error: true
28+
strategy:
29+
max-parallel: 1
30+
fail-fast: false # Don't fail fast to avoid locking TF State
31+
matrix:
32+
platform: [terraform, opentofu]
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
ref: ${{ inputs.ref }}
37+
38+
- shell: bash
39+
run: |
40+
mkdir -p ${{ runner.temp }}
41+
cp ./tests/${{ matrix.platform }}/atmos.yaml ${{ runner.temp }}/atmos.yaml
42+
sed -i -e 's#__INFRACOST_ENABLED__#false#g' ${{ runner.temp }}/atmos.yaml
43+
sed -i -e 's#__STORAGE_REGION__#${{ env.AWS_REGION }}#g' ${{ runner.temp }}/atmos.yaml
44+
sed -i -e 's#__STORAGE_BUCKET__#${{ secrets.TERRAFORM_STATE_BUCKET }}#g' ${{ runner.temp }}/atmos.yaml
45+
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
46+
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
47+
sed -i -e 's#__STORAGE_ROLE__#${{ secrets.TERRAFORM_STATE_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
48+
sed -i -e 's#__PLAN_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
49+
sed -i -e 's#__APPLY_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
50+
51+
echo "seed=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${{ matrix.platform }}" >> $GITHUB_OUTPUT
52+
53+
- name: Plan Atmos Component
54+
uses: cloudposse/github-action-atmos-terraform-plan@v4
55+
with:
56+
component: "foobar-plan-diff"
57+
stack: "plat-ue2-sandbox"
58+
atmos-config-path: ${{ runner.temp }}
59+
debug: true
60+
sha: ${{ inputs.sha }}
61+
env:
62+
TF_VAR_seed: ${{ steps.env.outputs.seed }}-a
63+
64+
- uses: actions/checkout@v4
65+
with:
66+
ref: ${{ inputs.ref }}
67+
68+
- name: Wait 15 sec to wait s3 bucket would be consistent (read after write consistency)
69+
shell: bash
70+
run: |
71+
sleep 15;
72+
73+
- name: Apply Atmos Component
74+
uses: ./
75+
with:
76+
component: "foobar-plan-diff"
77+
stack: "plat-ue2-sandbox"
78+
atmos-config-path: ${{ runner.temp }}
79+
debug: true
80+
sha: ${{ inputs.sha }}
81+
env:
82+
TF_VAR_seed: ${{ steps.env.outputs.seed }}-b
83+

.github/workflows/test-plan_fail.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Integration Tests - Plan Fail"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: "The fully-formed ref of the branch or tag that triggered the workflow run"
8+
required: false
9+
type: string
10+
sha:
11+
description: "The sha of the commit that triggered the workflow run"
12+
required: false
13+
type: string
14+
15+
env:
16+
AWS_REGION: us-east-2
17+
18+
19+
# Permissions required for assuming AWS identity
20+
permissions:
21+
id-token: write
22+
contents: read
23+
24+
jobs:
25+
test:
26+
runs-on: ubuntu-latest
27+
continue-on-error: true
28+
strategy:
29+
max-parallel: 1
30+
fail-fast: false # Don't fail fast to avoid locking TF State
31+
matrix:
32+
platform: [terraform, opentofu]
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
ref: ${{ inputs.ref }}
37+
38+
- shell: bash
39+
id: env
40+
run: |
41+
mkdir -p ${{ runner.temp }}
42+
cp ./tests/${{ matrix.platform }}/atmos.yaml ${{ runner.temp }}/atmos.yaml
43+
sed -i -e 's#__INFRACOST_ENABLED__#false#g' ${{ runner.temp }}/atmos.yaml
44+
sed -i -e 's#__STORAGE_REGION__#${{ env.AWS_REGION }}#g' ${{ runner.temp }}/atmos.yaml
45+
sed -i -e 's#__STORAGE_BUCKET__#${{ secrets.TERRAFORM_STATE_BUCKET }}#g' ${{ runner.temp }}/atmos.yaml
46+
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
47+
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
48+
sed -i -e 's#__STORAGE_ROLE__#${{ secrets.TERRAFORM_STATE_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
49+
sed -i -e 's#__PLAN_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
50+
sed -i -e 's#__APPLY_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
51+
52+
echo "seed=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${{ matrix.platform }}" >> $GITHUB_OUTPUT
53+
54+
- uses: actions/checkout@v4
55+
with:
56+
ref: ${{ inputs.ref }}
57+
58+
- name: Apply Atmos Component
59+
uses: ./
60+
with:
61+
component: "foobar-plan-fail"
62+
stack: "plat-ue2-sandbox"
63+
atmos-config-path: ${{ runner.temp }}
64+
plan-storage: false
65+
debug: true
66+
sha: ${{ inputs.sha }}
67+
env:
68+
TF_VAR_seed: ${{ steps.env.outputs.seed }}
69+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: "Integration Tests - Plan Storage disabled"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: "The fully-formed ref of the branch or tag that triggered the workflow run"
8+
required: false
9+
type: string
10+
sha:
11+
description: "The sha of the commit that triggered the workflow run"
12+
required: false
13+
type: string
14+
15+
env:
16+
AWS_REGION: us-east-2
17+
18+
19+
# Permissions required for assuming AWS identity
20+
permissions:
21+
id-token: write
22+
contents: read
23+
24+
jobs:
25+
test:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
max-parallel: 1
29+
fail-fast: false # Don't fail fast to avoid locking TF State
30+
matrix:
31+
platform: [terraform, opentofu]
32+
steps:
33+
- uses: actions/checkout@v4
34+
with:
35+
ref: ${{ inputs.ref }}
36+
37+
- shell: bash
38+
id: env
39+
run: |
40+
mkdir -p ${{ runner.temp }}
41+
cp ./tests/${{ matrix.platform }}/atmos.yaml ${{ runner.temp }}/atmos.yaml
42+
sed -i -e 's#__INFRACOST_ENABLED__#false#g' ${{ runner.temp }}/atmos.yaml
43+
sed -i -e 's#__STORAGE_REGION__#${{ env.AWS_REGION }}#g' ${{ runner.temp }}/atmos.yaml
44+
sed -i -e 's#__STORAGE_BUCKET__#${{ secrets.TERRAFORM_STATE_BUCKET }}#g' ${{ runner.temp }}/atmos.yaml
45+
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
46+
sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
47+
sed -i -e 's#__STORAGE_ROLE__#${{ secrets.TERRAFORM_STATE_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
48+
sed -i -e 's#__PLAN_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
49+
sed -i -e 's#__APPLY_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
50+
51+
echo "seed=${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}-${{ matrix.platform }}" >> $GITHUB_OUTPUT
52+
53+
- uses: actions/checkout@v4
54+
with:
55+
ref: ${{ inputs.ref }}
56+
57+
- name: Apply Atmos Component
58+
uses: ./
59+
with:
60+
component: "foobar-plan-storage"
61+
stack: "plat-ue2-sandbox"
62+
atmos-config-path: ${{ runner.temp }}
63+
plan-storage: false
64+
debug: true
65+
sha: ${{ inputs.sha }}
66+
env:
67+
TF_VAR_seed: ${{ steps.env.outputs.seed }}
68+

0 commit comments

Comments
 (0)