diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b3bbbd6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Run lint and tests + +on: + push: + branches: + - '**' + - '!master' + pull_request: + branches: + - '**' + - '!master' + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12'] + env: + PYPI_USERNAME: ${{ secrets.PYPI_READ_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_READ_PASSWORD }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: make reqs-ci + + - name: Run tests + run: make test-ci diff --git a/Makefile b/Makefile index 714fdff..41a628c 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,12 @@ test_install: install test: test_install python3 setup.py test +test-ci: + PIP_EXTRA_INDEX_URL="https://${PYPI_USERNAME}:${PYPI_PASSWORD}@pypi.dev.hearsaylabs.com/pypi/" tox + +reqs-ci: + pip install --extra-index-url "https://${PYPI_USERNAME}:${PYPI_PASSWORD}@pypi.dev.hearsaylabs.com/pypi/" + upload: create_dist pip install twine twine upload dist/* diff --git a/tox.ini b/tox.ini index 2c55f8b..3236e37 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,7 @@ envlist = [testenv] deps = + tox-gh parameterized pytest==6.2.5 pytest-cov==2.8.1