update build scripts #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint and Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| python: | |
| name: Python static checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Sync Python tooling | |
| run: uv sync --locked --only-group dev --no-install-project | |
| - name: Generate Python stubs | |
| run: cargo run --manifest-path Cargo.toml --package v8-python --bin stub_gen | |
| - name: Ruff | |
| run: uv run --no-sync ruff check . | |
| - name: Pyright | |
| run: uv run --no-sync pyright tests examples | |
| python-tests: | |
| name: Python tests | |
| runs-on: macos-14 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - uses: astral-sh/setup-uv@v4 | |
| with: | |
| enable-cache: true | |
| - name: Sync Python tooling | |
| run: uv sync --locked --only-group dev --no-install-project | |
| - name: Build extension | |
| run: uv run --no-sync maturin develop | |
| - name: Python tests | |
| run: uv run --no-sync python -m unittest discover | |
| rust: | |
| name: Rust | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Cargo check | |
| run: cargo check --all-targets | |
| - name: Cargo clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: Cargo tests | |
| run: cargo test --all-targets |