Skip to content

Commit

Permalink
move the trigger of integration tests to distribute, right before rel…
Browse files Browse the repository at this point in the history
…ease
  • Loading branch information
emileten committed Sep 27, 2023
1 parent 80f03ba commit 4ff82c2
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/distribute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ jobs:
package:
uses: ./.github/workflows/build.yaml

integration-test:
uses: ./.github/workflows/integration-test.yaml
needs: package

distribute-python:
runs-on: ubuntu-latest
needs: package
steps:
- uses: actions/download-artifact@v3
with:
name: python
path: dist

- run: pip install twine

- run: twine upload dist/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
name: Deploy & Test Deployment
name: Deploy & Integration Test

permissions:
id-token: write # required for requesting the JWT
contents: read # required for actions/checkout

on:
# run this workflow when the `Distribute` workflow completes
workflow_run:
workflows: [Distribute]
types: [completed]
# ... or manually.
workflow_call:

workflow_dispatch:

# remove later
push:
branches:
- "feat/add-integration-tests"
# push:
# branches:
# - "feat/add-integration-tests"

jobs:
# run a job on a successful `Workflow` run.
on-successful-release:
deploy-and-integration-test:
name: Deploy & Integration Test
runs-on: ubuntu-latest
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION_DEPLOY }}
Expand All @@ -41,14 +38,22 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '18'


- name: Download compiled eoapi-cdk artifact
uses: actions/download-artifact@v3
with:
name: python
path: dist

- name: Install eoapi-cdk from artifact
run: pip install dist/python/*.gz

- name: Install deployment environment
working-directory: integration_tests/cdk
run: |
python -m venv .deployment_venv
source .deployment_venv/bin/activate
pip install -r requirements.txt
pip install --upgrade eoapi-cdk # make sure to take the latest version of eoapi-cdk since we're integration-testing the newest release.
npm install
deactivate
Expand Down Expand Up @@ -76,7 +81,7 @@ jobs:
run: |
python -m venv .tests_venv
source .tests_venv/bin/activate
pip install -r requirements.txt
pip install -e .
deactivate
- name: Test the stack
Expand Down
10 changes: 9 additions & 1 deletion integration_tests/cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ source .venv/bin/activate
python -m pip install -r requirements.txt
```

Note that `eoapi-cdk` isn't pinned, so that the latest version is always installed. Also install node dependencies with
Install the latest `eoapi-cdk` either from PyPI:

```
pip install eoapi-cdk
```

Or alternatively, compile and package from the root of this repository to get the python version of the constructs locally.

This comment has been minimized.

Copy link
@sharkinsspatial

sharkinsspatial Oct 9, 2023

Member

For simplicity I would change the docs to always recommend installing the locally built package.


Also install node dependencies with

```
npm install
Expand Down
1 change: 0 additions & 1 deletion integration_tests/cdk/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
aws-cdk-lib>=2.75.0
aws_cdk.aws_cognito_identitypool_alpha>=2.75.0a0
aws-cdk.aws-apigatewayv2-alpha==2.95.1a0
eoapi-cdk
constructs>=10.0.0,<11.0.0
pydantic==2.0.2
pydantic-settings==2.0.1
Expand Down

0 comments on commit 4ff82c2

Please sign in to comment.