Skip to content

[pre-commit.ci] pre-commit autoupdate #103

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #103

on:
pull_request:
workflow_dispatch:
push:
tags:
- "*"
branches:
- main
jobs:
unit_testing:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
env:
KEEPAKEY: ${{ secrets.KEEPAKEY }}
WEAKKEEPAKEY: ${{ secrets.WEAKKEEPAKEY }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/setup.py
**/requirements*.txt
- name: Install
run: |
python setup.py sdist
pip install dist/*.tar.gz --disable-pip-version-check
cd tests/
python -c "import keepa"
- name: Validate Keys
run: |
python -c "import os, keepa; keepa.Keepa(os.environ.get('KEEPAKEY'))"
- name: Unit testing
run: |
pip install -r requirements_test.txt --disable-pip-version-check
cd tests
pytest -v --cov keepa --cov-report xml
- uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11'
name: 'Upload coverage to codecov'
- name: Upload to PyPi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
pip install twine
python setup.py sdist
twine upload --skip-existing dist/keepa*.tar.gz
env: # Or as an environment variable
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}
TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"