Add Recipe-Sharing API and Car Rental Rails samples with DSQL integra… #110
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python Psycopg2 integration tests | |
| permissions: {} | |
| on: | |
| workflow_call: {} | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| create-cluster: | |
| uses: ./.github/workflows/dsql-cluster-create.yml | |
| with: | |
| workflow_name: python-psycopg2 | |
| secrets: | |
| AWS_IAM_ROLE: ${{ secrets.PYTHON_IAM_ROLE }} | |
| permissions: | |
| id-token: write # required by aws-actions/configure-aws-credentials | |
| python-psycopg2-integ-test: | |
| needs: create-cluster | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # required by aws-actions/configure-aws-credentials | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Cache pip packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: ${{ secrets.PYTHON_IAM_ROLE }} | |
| aws-region: ${{ needs.create-cluster.outputs.region }} | |
| - name: Configure and run integration for psycopg2 - admin | |
| working-directory: ./python/psycopg2 | |
| env: | |
| CLUSTER_USER: "admin" | |
| CLUSTER_ENDPOINT: ${{ needs.create-cluster.outputs.cluster-endpoint }} | |
| REGION: ${{ needs.create-cluster.outputs.region }} | |
| run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| pip install --upgrade pip | |
| pip install --force-reinstall -r requirements.txt | |
| python3 -c "import boto3; print(boto3.__version__)" | |
| pip list | |
| echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH | |
| wget https://www.amazontrust.com/repository/AmazonRootCA1.pem -O root.pem | |
| pytest | |
| delete-cluster: | |
| if: always() && needs.create-cluster.result == 'success' | |
| needs: [create-cluster, python-psycopg2-integ-test] | |
| uses: ./.github/workflows/dsql-cluster-delete.yml | |
| with: | |
| cluster-id: ${{ needs.create-cluster.outputs.cluster-id }} | |
| region: ${{ needs.create-cluster.outputs.region }} | |
| secrets: | |
| AWS_IAM_ROLE: ${{ secrets.PYTHON_IAM_ROLE }} | |
| permissions: | |
| id-token: write # required by aws-actions/configure-aws-credentials |