Skip to content

Commit 1c7fbf6

Browse files
committed
🔧 Template: Add tests job to CI workflow
We choose to only test against the min and max Python versions supported, and run the provided Hatch script for running the tests. Note that we pin `click==8.1.8` because `8.3.0` breaks Hatch, `8.2.2` has been yanked, and `8.1.8` is the latest version that supports Python 3.9.
1 parent 4ba761b commit 1c7fbf6

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Template for Python packages based on [`copier`](https://copier.readthedocs.io/e
1111
* 🧹 **Pre-commit**: Format and lint your code with [Ruff](https://docs.astral.sh/ruff/).
1212
* ⚙️ **GitHub Actions**:
1313
* Deploy documentation to [GitHub Pages](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site).
14-
* Run pre-commit checks on every pull request.
14+
* Run pre-commit checks and tests on every pull request.
1515

1616
## Usage
1717

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A `copier`-based template for Python packages.
99
* 🧹 **Pre-commit**: Format and lint your code with [Ruff](https://docs.astral.sh/ruff/).
1010
* ⚙️ **GitHub Actions**:
1111
* Deploy documentation to [GitHub Pages](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site).
12-
* Run pre-commit checks on every pull request.
12+
* Run pre-commit checks and tests on every pull request.
1313

1414
## Usage
1515

template/.github/workflows/.ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,21 @@ jobs:
1414
python-version: '3.13'
1515

1616
- name: Install Hatch
17-
run: pip install click==8.2.1 hatch
17+
run: pip install click==8.1.8 hatch
1818

1919
- name: Run pre-commit
2020
run: hatch run precommit:run
21+
22+
tests:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
matrix:
26+
python-version: ['3.9', '3.13']
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
- run: pip install click==8.2.1 hatch
34+
- run: hatch run test:run

0 commit comments

Comments
 (0)