1+ name : " Test - Atmos Pro Enabled"
2+
3+ on :
4+ workflow_dispatch : {}
5+
6+ pull_request :
7+ types : [opened, synchronize, reopened]
8+
9+ env :
10+ AWS_REGION : us-east-2
11+
12+ # Permissions required for assuming AWS identity
13+ permissions :
14+ id-token : write
15+ contents : read
16+
17+ jobs :
18+ setup :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Setup
22+ run : echo "Do setup"
23+
24+ test :
25+ runs-on : ubuntu-latest
26+ continue-on-error : true
27+ needs : [setup]
28+ steps :
29+ - name : Checkout
30+ uses : actions/checkout@v4
31+ with :
32+ ref : ${{ github.event.pull_request.head.ref }}
33+
34+ - name : Setup Atmos Test Config
35+ shell : bash
36+ run : |
37+ mkdir -p ${{ runner.temp }}
38+ cp ./tests/opentofu/atmos.yaml ${{ runner.temp }}/atmos.yaml
39+ sed -i -e 's#__INFRACOST_ENABLED__#false#g' ${{ runner.temp }}/atmos.yaml
40+ sed -i -e 's#__STORAGE_REGION__#${{ env.AWS_REGION }}#g' ${{ runner.temp }}/atmos.yaml
41+ sed -i -e 's#__STORAGE_BUCKET__#${{ secrets.TERRAFORM_STATE_BUCKET }}#g' ${{ runner.temp }}/atmos.yaml
42+ sed -i -e 's#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g' ${{ runner.temp }}/atmos.yaml
43+ sed -i -e 's#__STORAGE_ROLE__#${{ secrets.TERRAFORM_STATE_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
44+ sed -i -e 's#__PLAN_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
45+ sed -i -e 's#__APPLY_ROLE__#${{ secrets.TERRAFORM_APPLY_ROLE }}#g' ${{ runner.temp }}/atmos.yaml
46+
47+ cat ${{ runner.temp }}/atmos.yaml
48+
49+ - name : Plan Atmos Component
50+ uses : cloudposse/github-action-atmos-terraform-plan@v4
51+ with :
52+ component : " foobar-atmos-pro"
53+ stack : " plat-ue2-sandbox"
54+ atmos-config-path : ${{ runner.temp }}
55+
56+ - uses : actions/checkout@v4
57+ with :
58+ ref : ${{ github.event.pull_request.head.ref }}
59+
60+ - name : Wait 15 sec to wait s3 bucket would be consistent (read after write consistency)
61+ shell : bash
62+ run : |
63+ sleep 15;
64+
65+ - name : Apply Atmos Pro Component
66+ id : current
67+ uses : ./
68+ with :
69+ component : " foobar-atmos-pro"
70+ stack : " plat-ue2-sandbox"
71+ atmos-config-path : ${{ runner.temp }}
72+ atmos-version : " >= 1.174.0"
73+
74+ outputs :
75+ result : ${{ steps.current.outputs.status }}
76+
77+ assert :
78+ runs-on : ubuntu-latest
79+ needs : [test]
80+ steps :
81+ - uses : nick-fields/assert-action@v2
82+ with :
83+ expected : ' succeeded'
84+ actual : " ${{ needs.test.outputs.result }}"
85+
86+ teardown :
87+ runs-on : ubuntu-latest
88+ needs : [assert]
89+ if : ${{ always() }}
90+ steps :
91+ - name : Tear down
92+ run : echo "Do Tear down"
0 commit comments