diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e08e288 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +name: Python CI + +on: + pull_request: + branches: [ main, master ] + push: + branches: [ main, master ] + release: + types: [ released ] + workflow_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + name: Lint + steps: + - uses: actions/checkout@v4 + + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install tox + run: python -m pip install --upgrade tox + + - name: Run lint + run: tox -e lint + + test: + name: Python ${{ matrix.python-version }} (${{ matrix.platform }}) + needs: lint + runs-on: ${{ matrix.platform }} + + strategy: + fail-fast: false + matrix: + include: + - python-version: "3.9" + platform: ubuntu-latest + toxenv: py39 + - python-version: "3.10" + platform: ubuntu-latest + toxenv: py310 + - python-version: "3.11" + platform: ubuntu-latest + toxenv: py311 + - python-version: "3.12" + platform: ubuntu-latest + toxenv: py312 + - python-version: "3.13" + platform: ubuntu-latest + toxenv: py313 + - python-version: "3.12" + platform: macos-latest + toxenv: py312 + - python-version: "3.12" + platform: windows-latest + toxenv: py312 + + steps: + - uses: actions/checkout@v4 + + - name: Install python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install tox + run: python -m pip install --upgrade tox + + - name: Run tests + run: tox -e ${{ matrix.toxenv }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ab8abaa..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: python -python: - - 2.7 - - 3.6 - - 3.7 -install: - - pip install -r requirements.txt - - pip install pytest-cov coveralls -before_script: flake8 bugsy -script: python setup.py develop && py.test --cov bugsy tests -after_success: coveralls -deploy: - provider: pypi - distributions: sdist bdist_wheel - username: __token__ - # password: see secret PYPI_PASSWORD variable - on: - branch: master - tags: true - os: linux - python: 3.7 diff --git a/tox.ini b/tox.ini index a26756f..805d5c2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,13 @@ [tox] envlist = py3{9,10,11,12,13} + [testenv] deps = -rrequirements.txt commands=py.test + +[testenv:lint] +commands = + pre-commit run -a {posargs} +deps = + pre-commit +skip_install = true