Skip to content

Merge pull request #35 from candidco/mar/update-codeowners #124

Merge pull request #35 from candidco/mar/update-codeowners

Merge pull request #35 from candidco/mar/update-codeowners #124

Workflow file for this run

name: pytest
on: [push]
jobs:
test:
runs-on: ${{ matrix.os-python-version.os }}
strategy:
max-parallel: 4
matrix:
os-python-version:
[
{ "os": "ubuntu-18.04", "python": 3.6 },
{ "os": "ubuntu-latest", "python": 3.7 },
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.os-python-version.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.os-python-version.python }}
- name: Install dependencies
run: |
pip install poetry>=0.12
poetry config virtualenvs.create false --local
poetry install
- name: Test with pytest
run: |
pytest
build_and_deploy:
needs: test
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a source tarball
run: |
python -m build --sdist --outdir dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Push to s3
env:
AWS_S3_BUCKET: pypi.candidco.com
SOURCE_DIR: "."
run: |
pip install s3pypi==0.11.0
pip install poetry2setup
poetry2setup > setup.py
s3pypi --bucket pypi.candidco.com --private || echo "ERROR: push failed for $package";