Run checks on every change
Continuous integration (CI) runs a repeatable set of checks on a fresh machine. For TaskFlow the useful questions are specific: can Python compile the package, do the storage and CLI tests pass, and can a user install the project and launch its command?
On this page
Choose a repository layout
For this guide, use the contents of the capstone’s app directory as the repository root. At that level you should see pyproject.toml, taskflow/, tests/, and README.md. Put the workflow at .github/workflows/checks.yml. Exclude local virtual environments and generated wheels from the repository.
Describe the checks
The following GitHub Actions workflow runs on pushes and pull requests. Its matrix creates separate jobs for two Python versions. The project declares 3.12 as its minimum, so that version belongs in the test matrix.
name: Python checks
on: [push, pull_request]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install test tools and the application
run: python -m pip install pytest .
- name: Check Python syntax
run: python -m compileall -q taskflow
- name: Test behavior
run: python -m pytest -q tests
- name: Check the installed command
run: |
cd "$RUNNER_TEMP"
taskflow --helpThe final step runs outside the checkout so the imported package must be installed. A failed process gives its step a nonzero exit status. The test report identifies which Python version, test, and assertion failed. Passing jobs show that these particular checks succeeded on these two versions.
Reproduce a failure locally
Read the first failing step and copy its test name. In a local environment using the same Python version, install pytest and the application, then select a single failing test. For example, the capstone includes this CLI test.
python -m pytest -q tests/test_cli.py::test_help_is_successful_without_writing_dataUse python -m pytest -q tests after correcting the problem to catch changes in related behavior. If a dependency update caused the failure, record which version changed and test the intended dependency set again.