Skip to content

Commit b14d4f2

Browse files
authored
build(CI): enable mypy and disable "build" in CI workflow (#541)
* build(mypy): run mypy in CI workflow * build: no longer run build in CI workflow * fix: always `source .venv/bin/activate` before each step * test: inject a mypy error * test: revert prevsious injected error * style: minor words adjustment for workflow
1 parent 65fa7ff commit b14d4f2

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,6 @@ permissions:
2626
contents: read
2727

2828
jobs:
29-
build:
30-
runs-on: ${{ matrix.platform.runner }}
31-
strategy:
32-
matrix:
33-
platform:
34-
- { os: linux, runner: ubuntu-24.04, target: x86_64, container: "ghcr.io/rust-cross/manylinux_2_28-cross:x86_64" }
35-
- { os: macos, runner: macos-15, target: aarch64 }
36-
steps:
37-
- uses: actions/checkout@v4
38-
- uses: actions/setup-python@v5
39-
with:
40-
python-version: 3.x
41-
- name: Build wheels
42-
uses: PyO3/maturin-action@v1
43-
with:
44-
target: ${{ matrix.platform.target }}
45-
args: --release --out dist --find-interpreter
46-
sccache: 'true'
47-
manylinux: auto
48-
container: ${{ matrix.platform.container }}
4929
test:
5030
name: Run test
5131
uses: ./.github/workflows/_test.yml

.github/workflows/_test.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,28 @@ jobs:
3030
with:
3131
python-version: ${{ matrix.python-version }}
3232
cache: 'pip'
33+
- name: Setup venv
34+
run: |
35+
python -m venv .venv
3336
- uses: actions/cache@v4
3437
with:
3538
path: .venv
3639
key: ${{ runner.os }}-pythonenv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
3740
restore-keys: |
3841
${{ runner.os }}-pythonenv-${{ matrix.python-version }}-
39-
- name: Python build & test
42+
- name: Install Python toolchains
43+
run: |
44+
source .venv/bin/activate
45+
pip install maturin pytest mypy
46+
- name: Python build
4047
run: |
41-
python -m venv .venv
4248
source .venv/bin/activate
43-
pip install maturin pytest
4449
maturin develop
50+
- name: Python type check (mypy)
51+
run: |
52+
source .venv/bin/activate
53+
mypy python
54+
- name: Python tests
55+
run: |
56+
source .venv/bin/activate
4557
pytest python/cocoindex/tests

0 commit comments

Comments
 (0)