Skip to content

Commit

Permalink
add test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gcseter committed Oct 8, 2024
1 parent d84ef57 commit 151171a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ envlist =

[testenv]
deps =
tox-gh
parameterized
pytest==6.2.5
pytest-cov==2.8.1
Expand Down

0 comments on commit 151171a

Please sign in to comment.