Skip to content

Commit b675f81

Browse files
committed
chore(ci): migrate cicd to hatch
With Hatch as the new build system, the previous GitHub actions no longer work to lint, test, and publish the package. This commit makes use of pypa/cibuildwheel to build the package for multiple platforms, and then publishes the package to PyPI using the existing secrets. Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent cb00f51 commit b675f81

File tree

3 files changed

+61
-81
lines changed

3 files changed

+61
-81
lines changed

.github/workflows/build_and_test.yml

-54
This file was deleted.

.github/workflows/package_and_push_to_pypi.yml

-27
This file was deleted.

.github/workflows/test.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
STABLE_PYTHON_VERSION: "3.11"
17+
18+
jobs:
19+
run:
20+
name: >-
21+
Python ${{ matrix.python-version }}
22+
on ${{ matrix.os }}
23+
24+
runs-on: ${{ matrix.os }}
25+
continue-on-error: ${{ matrix.experimental }}
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-latest, windows-latest, macos-latest]
31+
python-version: ["3.8", "3.9", "3.10", "3.11"]
32+
experimental: [false]
33+
include:
34+
- # Run tests against the next Python version, but no need for the full list of OSes.
35+
os: ubuntu-latest
36+
python-version: "3.12-dev"
37+
experimental: true
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v4
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Install Hatch
48+
run: pip install --upgrade hatch
49+
50+
- # TODO: Fix lints before enabling this
51+
name: Lint
52+
if: matrix.python-version == env.STABLE_PYTHON_VERSION && runner.os == 'Linux'
53+
run: echo hatch run lint
54+
55+
- # TODO: Implement the examples to work in hatch
56+
name: Examples
57+
if: matrix.python-version == env.STABLE_PYTHON_VERSION && runner.os == 'Linux'
58+
run: echo hatch run example
59+
60+
- name: Run tests and track code coverage
61+
run: hatch run test

0 commit comments

Comments
 (0)