Skip to content

Commit

Permalink
Run pytest from source and on built wheel (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche authored Jan 4, 2025
1 parent 70b5069 commit 6843e1c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ jobs:
command: upload
args: --non-interactive --skip-existing wheels-*/*

pytest-linux:
runs-on: ubuntu-latest
name: "Python Tests (on built wheel)"
needs: linux
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- run: pip install poetry
- run: poetry install
- run: poetry run pip install wheels-linux-x86_64/*
- run: poetry run pytest

stubtest:
runs-on: ubuntu-latest
name: "Stub Test"
Expand All @@ -192,4 +207,4 @@ jobs:
python-version: 3.9
- run: pip install wheels-linux-x86_64/*
- run: pip install mypy
- run: python -m mypy.stubtest taskchampion --ignore-missing-stub
- run: python -m mypy.stubtest taskchampion --ignore-missing-stub
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: tests

on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]

jobs:
test:
runs-on: ubuntu-latest
name: "Python Tests"

steps:
- uses: actions/checkout@v4

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- uses: actions-rs/toolchain@v1
with:
toolchain: "1.78.0" # MSRV
override: true
components: clippy

- uses: actions/setup-python@v5
with:
python-version: 3.9

- run: pip install poetry
- run: poetry install
- run: poetry run maturin develop
- run: poetry run pytest

0 comments on commit 6843e1c

Please sign in to comment.