@@ -5,7 +5,11 @@ permissions:
5
5
contents : read # required for actions/checkout
6
6
7
7
on :
8
- workflow_dispatch :
8
+
9
+ push :
10
+ branches :
11
+ - " feat/add-integration-tests"
12
+
9
13
10
14
jobs :
11
15
deploy-and-integration-test :
@@ -22,59 +26,69 @@ jobs:
22
26
- name : Set up python
23
27
uses : actions/setup-python@v2
24
28
with :
25
- python-version : 3.10
26
29
cache : pip
27
-
28
- - name : Install dependencies to deploy the stack
30
+
31
+ - name : Install deployment environment
32
+ working-directory : eoapi-template
29
33
run : |
30
- cd eoapi-template
31
34
python -m venv .deployment_venv
32
35
source .deployment_venv/bin/activate
33
36
pip install -r requirements.txt
34
37
pip install --upgrade eoapi-cdk
35
38
npm install -g aws-cdk
36
39
deactivate
37
- cd ..
40
+
41
+ - name : Synthesize the stack
42
+ working-directory : eoapi-template
43
+ env :
44
+ AWS_DEFAULT_REGION : ${{ secrets.AWS_DEFAULT_REGION_DEPLOY }}
45
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID_DEPLOY }}
46
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY_DEPLOY }}
47
+ run : |
48
+ source .deployment_venv/bin/activate
49
+ cdk synth --debug --all --require-approval never
50
+ deactivate
51
+
38
52
39
53
- name : Deploy the stack
54
+ id : deploy_step
55
+ working-directory : eoapi-template
40
56
env :
41
- AWS_DEFAULT_REGION : us-east-1
42
- AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
43
- AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
57
+ AWS_DEFAULT_REGION : ${{ secrets.AWS_DEFAULT_REGION_DEPLOY }}
58
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID_DEPLOY }}
59
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY_DEPLOY }}
44
60
run : |
45
- cd eoapi-template
46
61
source .deployment_venv/bin/activate
47
- cdk deploy --all --require-approval never
48
- echo "ingestor_url=$(aws cloudformation describe-stacks --stack-name eoapi-template-demo-test-pgSTAC-infra --query "Stacks[0].Outputs[?contains (OutputKey, 'stacingestor')].OutputValue | [0]" --output text)" >> $GITHUB_OUTPUT
49
- echo "stac_api_url=$(aws cloudformation describe-stacks --stack-name eoapi-template-demo-test-pgSTAC-infra --query "Stacks[0].Outputs[?contains (OutputKey, 'stacapi ')].OutputValue | [0]" --output text)" >> $GITHUB_OUTPUT
50
- echo "titiler_pgstac_api_url=$(aws cloudformation describe-stacks --stack-name eoapi-template-demo-test-pgSTAC-infra --query "Stacks[0].Outputs[?contains (OutputKey, 'titiler ')].OutputValue | [0]" --output text)" >> $GITHUB_OUTPUT
62
+ cdk deploy --ci -- all --require-approval never
63
+ echo "ingestor_url=$(aws cloudformation describe-stacks --stack-name eoapi-template-demo-test-pgSTAC-infra --query "Stacks[0].Outputs[?starts_with (OutputKey, 'stacingestor')].OutputValue | [0]" --output text)" >> $GITHUB_OUTPUT
64
+ echo "stac_api_url=$(aws cloudformation describe-stacks --stack-name eoapi-template-demo-test-pgSTAC-infra --query "Stacks[0].Outputs[?starts_with (OutputKey, 'pgstacapi ')].OutputValue | [0]" --output text)" >> $GITHUB_OUTPUT
65
+ echo "titiler_pgstac_api_url=$(aws cloudformation describe-stacks --stack-name eoapi-template-demo-test-pgSTAC-infra --query "Stacks[0].Outputs[?starts_with (OutputKey, 'titilerpgstac ')].OutputValue | [0]" --output text)" >> $GITHUB_OUTPUT
51
66
deactivate
52
- cd ..
53
67
54
68
- name : Checkout the repo with the tests
55
69
uses : actions/checkout@v3
56
70
with :
57
71
repository : developmentseed/eoapi-tests
72
+ ref : initial-PR
58
73
path : tests
59
74
60
75
- name : Test the stack
76
+ working-directory : tests
61
77
env :
62
- ingestor_url : ${{ steps.deploy_the_stack .outputs.ingestor_url }}
63
- stac_api_url : ${{ steps.deploy_the_stack .outputs.stac_api_url }}
64
- titiler_pgstac_api_url : ${{ steps.deploy_the_stack .outputs.titiler_api_url }}
78
+ ingestor_url : ${{ steps.deploy_step .outputs.ingestor_url }}
79
+ stac_api_url : ${{ steps.deploy_step .outputs.stac_api_url }}
80
+ titiler_pgstac_api_url : ${{ steps.deploy_step .outputs.titiler_pgstac_api_url }}
65
81
run : |
66
- cd tests
67
82
python -m venv .tests_venv
68
83
source .tests_venv/bin/activate
69
- pip install -e tests
70
- pytest eoapi-tests
84
+ pip install -e .
85
+ pytest eoapi_tests
71
86
deactivate
72
- cd ..
73
87
74
- - name : Tear down the stack
88
+ - name : Always tear down the stack
89
+ if : always()
90
+ working-directory : eoapi-template
75
91
run : |
76
- cd eoapi-template
77
92
source .deployment_venv/bin/activate
78
- cdk destroy --all --require-approval never
93
+ cdk destroy --ci --all --force
79
94
deactivate
80
- cd ..
0 commit comments