Skip to content

CHO: Update tox.ini to use poetry #240

CHO: Update tox.ini to use poetry

CHO: Update tox.ini to use poetry #240

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions. On successful
# test, the package will be published to the test PyPi server.
name: python-ci
on:
push:
branches-ignore:
- main
jobs:
check-semantic-version:
if: "!contains(github.event.head_commit.message, 'skipci')"
uses: octue/workflows/.github/workflows/check-semantic-version.yml@main
with:
path: pyproject.toml
breaking_change_indicated_by: minor
run-tests:
if: "!contains(github.event.head_commit.message, 'skipci')"
runs-on: ubuntu-latest
env:
USING_COVERAGE: '3.9'
strategy:
matrix:
python: ['3.8', '3.9']
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: pip install tox
- name: Run tests
run: tox
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
test-publish:
runs-on: ubuntu-latest
needs: [check-semantic-version, run-tests]
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Poetry
uses: snok/install-poetry@v1.4.1
- name: Build a binary wheel and a source tarball
run: poetry build
- name: Test package is publishable with PyPI test server
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
verbose: true