ci: coverage #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PyPi Publish | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 1 | |
fail-fast: true | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.10", "3.11", "3.12"] | |
env: | |
TOGGL_WORKSPACE_ID: ${{ secrets.TOGGL_WORKSPACE_ID }} | |
TOGGL_API_TOKEN: ${{ secrets.TOGGL_API_TOKEN }} | |
GH_ACTION: "ACTION" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
pip install tox-gh-actions tox ruff mypy | |
- name: Type check | |
run: mypy toggl_api | |
- name: Lint code | |
run: ruff check toggl_api | |
- name: Run tests | |
run: tox | |
- name: Upload coverage reports to Codecov | |
if: ${{ matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest' }} | |
uses: codecov/[email protected] | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build and publish to pypi | |
uses: JRubics/[email protected] | |
with: | |
pypi_token: ${{ secrets.PYPI_TOKEN }} | |
poetry_install_options: "--without=dev,docs" |