|
| 1 | +name: Python asyncpg integration tests |
| 2 | + |
| 3 | +permissions: {} |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ main ] |
| 8 | + paths: |
| 9 | + - 'python/asyncpg/**' |
| 10 | + - '.github/workflows/python-asyncpg-integ-tests.yml' |
| 11 | + pull_request: |
| 12 | + branches: [ main ] |
| 13 | + paths: |
| 14 | + - 'python/asyncpg/**' |
| 15 | + - '.github/workflows/python-asyncpg-integ-tests.yml' |
| 16 | + # Give us a button to allow running the workflow on demand for testing. |
| 17 | + workflow_dispatch: |
| 18 | + inputs: |
| 19 | + tags: |
| 20 | + description: 'Manual Workflow Run' |
| 21 | + required: false |
| 22 | + type: string |
| 23 | + |
| 24 | +jobs: |
| 25 | + python-asyncpg-integ-test: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + permissions: |
| 28 | + id-token: write # required by aws-actions/configure-aws-credentials |
| 29 | + concurrency: |
| 30 | + # Ensure only 1 job uses the workflow cluster at a time. |
| 31 | + group: ${{ github.workflow }} |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout code |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Set up Python |
| 38 | + uses: actions/setup-python@v5 |
| 39 | + with: |
| 40 | + python-version: '3.10' |
| 41 | + |
| 42 | + - name: Cache pip packages |
| 43 | + uses: actions/cache@v4 |
| 44 | + with: |
| 45 | + path: ~/.cache/pip |
| 46 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
| 47 | + restore-keys: | |
| 48 | + ${{ runner.os }}-pip- |
| 49 | +
|
| 50 | + - name: Configure AWS Credentials |
| 51 | + uses: aws-actions/configure-aws-credentials@v4 |
| 52 | + with: |
| 53 | + role-to-assume: ${{ secrets.PYTHON_IAM_ROLE }} |
| 54 | + aws-region: us-east-1 |
| 55 | + |
| 56 | + - name: Configure and run integration for asyncpg - admin |
| 57 | + working-directory: ./python/asyncpg |
| 58 | + env: |
| 59 | + CLUSTER_USER: "admin" |
| 60 | + CLUSTER_ENDPOINT: ${{ secrets.PYTHON_PSYCOPG3_CLUSTER_ENDPOINT }} |
| 61 | + run: | |
| 62 | + python3 -m venv .venv |
| 63 | + source .venv/bin/activate |
| 64 | + pip install --upgrade pip |
| 65 | + pip install --force-reinstall -r requirements.txt |
| 66 | + python3 -c "import boto3; print(boto3.__version__)" |
| 67 | + pip list |
| 68 | + echo "$GITHUB_WORKSPACE" >> $GITHUB_PATH |
| 69 | + wget https://www.amazontrust.com/repository/AmazonRootCA1.pem -O root.pem |
| 70 | + pytest |
0 commit comments