Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/setup-poetry/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup Poetry
description: Cross-platform Poetry installation

runs:
using: "composite"
steps:
- name: Install Poetry (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install Poetry (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
echo "$env:APPDATA\Python\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append

123 changes: 123 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Python CI

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
release:
types: [ released ]

jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
uses: ./.github/actions/setup-poetry

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.cache/pip
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-

- name: Install dependencies
run: poetry install

- 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 Poetry
uses: ./.github/actions/setup-poetry

- name: Install dependencies
run: poetry install

- name: Install tox
run: python -m pip install --upgrade tox

- name: Run tests
run: tox -e ${{ matrix.toxenv }}

- name: Run Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: tox -e codecov

release:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master' && github.event_name == 'push'

steps:
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
uses: ./.github/actions/setup-poetry

- name: Install dependencies
run: poetry install

- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run semantic-release publish
102 changes: 0 additions & 102 deletions .taskcluster.yml

This file was deleted.

3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ disable = [
[tool.pytest.ini_options]
log_level = "DEBUG"

[tool.semantic_relase.publish]
upload_to_vcs_release = false

[tool.semantic_release]
build_command = "poetry build"
commit_message = "chore(release): {version} [skip ci]"
Expand Down
15 changes: 7 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ commands = poetry run pytest --cache-clear --cov="{toxinidir}" --cov-config="{to
skip_install = true

[testenv:codecov]
allowlist_externals =
codecov
poetry
commands =
poetry run coverage xml --ignore-errors
codecov
deps = coverage[toml]
passenv = CODECOV_TOKEN
codecov upload-process
deps =
codecov-cli
coverage[toml]
passenv =
CODECOV_TOKEN
skip_install = true

[testenv:lint]
Expand All @@ -28,7 +27,7 @@ skip_install = true

[testenv:release]
commands =
semantic-release -v version --no-changelog --no-vcs-release
semantic-release -v version --no-changelog
semantic-release -v publish
passenv = HOME
skip_install = true
Expand Down