Skip to content

Standardize folder structure and format #64

Standardize folder structure and format

Standardize folder structure and format #64

name: Python Psycopg2 integration tests
permissions: {}
on:
push:
branches: [ main ]
paths:
- 'python/psycopg2/**'
- '.github/workflows/python-psycopg2-integ-tests.yml'
pull_request:
branches: [ main ]
paths:
- 'python/psycopg2/**'
- '.github/workflows/python-psycopg2-integ-tests.yml'
# Give us a button to allow running the workflow on demand for testing.
workflow_dispatch:
inputs:
tags:
description: 'Manual Workflow Run'
required: false
type: string
jobs:
python-psycopg2-integ-test:
runs-on: ubuntu-latest
permissions:
id-token: write # required by aws-actions/configure-aws-credentials
concurrency:
# Ensure only 1 job uses the workflow cluster at a time.
group: ${{ github.workflow }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Cache pip packages
uses: actions/cache@v4
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@v4
with:
role-to-assume: ${{ secrets.PYTHON_IAM_ROLE }}
aws-region: us-east-1
- name: Configure and run integration for psycopg2 - admin
working-directory: ./python/psycopg2
env:
CLUSTER_USER: "admin"
CLUSTER_ENDPOINT: ${{ secrets.PYTHON_PSYCOPG2_CLUSTER_ENDPOINT }}
REGION: ${{ secrets.PYTHON_PSYCOPG2_CLUSTER_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