11name : Run Tests (INTERNAL)
22
33on :
4- workflow_call :
4+ workflow_call :
55
66permissions :
77 contents : read
1010 CARGO_TERM_COLOR : always
1111
1212jobs :
13- build-test :
14- strategy :
15- matrix :
16- python-version : [3.11]
17- platform :
18- - { runner: ubuntu-latest, python_exec: ".venv/bin/python" }
19- - { runner: ubuntu-24.04-arm, python_exec: ".venv/bin/python" }
20- - { runner: macos-latest, python_exec: ".venv/bin/python" }
21- - { runner: macos-13, python_exec: ".venv/bin/python" }
22- - { runner: windows-latest, python_exec: ".venv\\Scripts\\python" }
23- runs-on : ${{ matrix.platform.runner }}
24- steps :
25- - uses : actions/checkout@v4
13+ build-test :
14+ strategy :
15+ matrix :
16+ python-version : [3.11]
17+ platform :
18+ - { runner: ubuntu-latest, python_exec: ".venv/bin/python" }
19+ - { runner: ubuntu-24.04-arm, python_exec: ".venv/bin/python" }
20+ - { runner: macos-latest, python_exec: ".venv/bin/python" }
21+ - { runner: macos-13, python_exec: ".venv/bin/python" }
22+ - { runner: windows-latest, python_exec: ".venv\\Scripts\\python" }
23+ runs-on : ${{ matrix.platform.runner }}
24+ steps :
25+ - uses : actions/checkout@v4
2626
27- - uses : actions/setup-python@v5
28- id : setup_python
29- with :
30- python-version : ${{ matrix.python-version }}
31- cache : ' pip'
27+ - uses : actions/setup-python@v5
28+ id : setup_python
29+ with :
30+ python-version : ${{ matrix.python-version }}
31+ cache : " pip"
3232
33- - run : rustup toolchain install stable --profile minimal
34- - name : Rust Cache
35- uses : Swatinem/rust-cache@v2
36- with :
37- key : rust-${{ matrix.platform.runner }}-${{ matrix.python-version }}
38- - name : Rust tests
39- run : cargo test --verbose
33+ - run : rustup toolchain install stable --profile minimal
34+ - name : Rust Cache
35+ uses : Swatinem/rust-cache@v2
36+ with :
37+ key : rust-${{ matrix.platform.runner }}-${{ matrix.python-version }}
38+ - name : Rust tests
39+ run : cargo test --verbose
4040
41- - uses : actions/cache@v4
42- with :
43- path : .venv
44- key : pyenv-${{ matrix.platform.runner }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}
45- restore-keys : |
46- pyenv-${{ matrix.platform.runner }}-${{ steps.setup_python.outputs.python-version }}-
41+ - name : Rust tests (no default features)
42+ run : cargo test --no-default-features --verbose
4743
48- - name : Setup venv
49- run : |
50- python -m venv .venv
51- - name : Install Python toolchains
52- run : |
53- ${{ matrix.platform.python_exec }} -m pip install maturin mypy pytest pytest-asyncio
54- - name : Python build
55- run : |
56- ${{ matrix.platform.python_exec }} -m maturin develop -E all
57- - name : Python type check (mypy)
58- run : |
59- ${{ matrix.platform.python_exec }} -m mypy python
60- - name : Python tests
61- run : |
62- ${{ matrix.platform.python_exec }} -m pytest --capture=no python/cocoindex/tests
44+ - uses : actions/cache@v4
45+ with :
46+ path : .venv
47+ key : pyenv-${{ matrix.platform.runner }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('pyproject.toml') }}
48+ restore-keys : |
49+ pyenv-${{ matrix.platform.runner }}-${{ steps.setup_python.outputs.python-version }}-
6350
64- validate-3p-notices :
65- runs-on : ubuntu-latest
66- steps :
67- - uses : actions/checkout@v4
68- - name : Install Rust toolchain
69- uses : dtolnay/rust-toolchain@stable
70- - uses : taiki-e/install-action@v2
71- with :
72- tool : cargo-binstall
73- - name : Install cargo-about
74- run : cargo binstall -y cargo-about
75- - name : Validate third-party notices (dry-run)
76- shell : bash
77- run : |
78- set +e
79- cargo about generate about.hbs > /dev/null
80- status=$?
81- if [ $status -ne 0 ]; then
82- echo "::error::Third-party notices validation failed. Please update /about.toml and rerun."
83- exit $status
84- fi
51+ - name : Setup venv
52+ run : |
53+ python -m venv .venv
54+ - name : Install Python toolchains
55+ run : |
56+ ${{ matrix.platform.python_exec }} -m pip install maturin mypy pytest pytest-asyncio
57+ - name : Python build
58+ run : |
59+ ${{ matrix.platform.python_exec }} -m maturin develop -E all
60+ - name : Python type check (mypy)
61+ run : |
62+ ${{ matrix.platform.python_exec }} -m mypy python
63+ - name : Python tests
64+ run : |
65+ ${{ matrix.platform.python_exec }} -m pytest --capture=no python/cocoindex/tests
66+
67+ validate-3p-notices :
68+ runs-on : ubuntu-latest
69+ steps :
70+ - uses : actions/checkout@v4
71+ - name : Install Rust toolchain
72+ uses : dtolnay/rust-toolchain@stable
73+ - uses : taiki-e/install-action@v2
74+ with :
75+ tool : cargo-binstall
76+ - name : Install cargo-about
77+ run : cargo binstall -y cargo-about
78+ - name : Validate third-party notices (dry-run)
79+ shell : bash
80+ run : |
81+ set +e
82+ cargo about generate about.hbs > /dev/null
83+ status=$?
84+ if [ $status -ne 0 ]; then
85+ echo "::error::Third-party notices validation failed. Please update /about.toml and rerun."
86+ exit $status
87+ fi
0 commit comments