Add GitHub actions support to tox #15
Workflow file for this run
This file contains 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: Tox Test | |
on: | |
pull_request: # This will trigger the workflow on all pull requests | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8.18, 3.10.15] # Match the Python versions in your tox envlist | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
echo "Upgrading pip..." | |
python -m pip install --upgrade pip | |
echo "Installing poetry..." | |
pip install poetry # Ensure poetry is installed as it's used in tox.ini | |
echo "Installing project dependencies with poetry..." | |
poetry install --no-root # Install all dependencies including dev-dependencies | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.CONNECTOR_TESTS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.CONNECTOR_TESTS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 # Change to your desired region | |
- name: Run Tox | |
run: | | |
echo "Running Tox tests... $AWS_ACCESS_KEY_ID" | |
poetry run tox | |
- name: Upload coverage.xml to S3 | |
run: | | |
echo "Uploading coverage.xml to S3..." | |
TIMESTAMP=$(date +%Y%m%d%H%M%S) | |
aws s3 cp coverage.xml s3://hotglue.connector-tests/${{ github.repository }}/metrics/coverage-${TIMESTAMP}.xml |