fix(drift-sync): mechanical model-family sync (2026-08-12) (#370) #710
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: Python Tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "packages/aimock-pytest/**" | |
| - "src/**" | |
| - "dist/**" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "packages/aimock-pytest/**" | |
| - "src/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| node-version: [20, 22, 24] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: { persist-credentials: false } | |
| - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: pnpm | |
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # Build the TS package first | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build | |
| # Set CLI path to local build | |
| - name: Set AIMOCK_CLI_PATH | |
| run: echo "AIMOCK_CLI_PATH=$PWD/dist/cli.js" >> $GITHUB_ENV | |
| # Install and test Python package | |
| - name: Install aimock-pytest | |
| # The build backend is hash-pinned and build isolation is OFF, so pip | |
| # does not resolve `build-system.requires` from PyPI and execute it here. | |
| # Measured on 2026-08-05: with the registry serving substituted bytes, | |
| # the old one-liner imported the substituted `hatchling.build` twice | |
| # (get_requires_for_build_wheel, then prepare_metadata) before it did | |
| # anything else. | |
| # | |
| # `requests` and `pytest` are STILL resolved unpinned, deliberately. This | |
| # job exists to catch breakage against current releases across four | |
| # Pythons; freezing them would retire that signal, and this job declares | |
| # no secrets and holds `contents: read`. The publish job — which does hold | |
| # a publish identity — installs from the same pinned file and builds the | |
| # same way, so the backend that builds a release is the backend tested here. | |
| # | |
| # `python -m pip` rather than `pip` so the interpreter that installs the | |
| # backend is the same one that has to import it during the build. | |
| run: | | |
| python -m pip install --require-hashes -r .github/requirements/hatchling.txt | |
| python -m pip install --no-build-isolation "./packages/aimock-pytest[test]" | |
| - name: Run Python tests | |
| run: cd packages/aimock-pytest && pytest tests/ -v |