Bump the github-actions group with 3 updates (#96) #195
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: tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: # allows running workflow manually from the Actions tab | |
| concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109 | |
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| rust_impl: | |
| name: rust-impl-${{ matrix.python-version }}-${{ matrix.rust-toolchain }}-${{ matrix.platform.name }} | |
| runs-on: ${{ matrix.platform.os }} | |
| strategy: | |
| matrix: | |
| # Keep in sync with: | |
| # - pyproject.toml | |
| # - dists.yml | |
| # - the c_impl tests below | |
| # - the mypy checks below | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| rust-toolchain: ["1.80", stable, beta, nightly] | |
| platform: [ | |
| { os: "ubuntu-latest", python-target: "linux-x86_64", rust-target: "x86_64-unknown-linux-gnu", name: "ubuntu-x64" }, | |
| { os: "macos-15-intel", python-target: "macos-x86_64", rust-target: "x86_64-apple-darwin", name: "macos-x64" }, | |
| { os: "macos-latest", python-target: "macos-aarch64", rust-target: "aarch64-apple-darwin", name: "macos-arm64" }, | |
| { os: "windows-latest", python-target: "windows-x86", rust-target: "i686-pc-windows-msvc", name: "windows-x86" }, | |
| { os: "windows-latest", python-target: "windows-x86_64", rust-target: "x86_64-pc-windows-msvc", name: "windows-x64" }, | |
| ] | |
| fail-fast: false | |
| env: | |
| CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust-toolchain }} | |
| target: ${{ matrix.platform.rust-target }} | |
| - run: uv venv --python cpython-${{ matrix.python-version }}-${{ matrix.platform.python-target }} | |
| - run: uv run tests/python_info.py | |
| - run: uv run pytest --verbose | |
| if: ${{ matrix.platform.rust-target != 'aarch64-apple-darwin' }} | |
| c_impl: | |
| name: c-impl-${{ matrix.python-version }}-${{ matrix.platform.name }} | |
| runs-on: ${{ matrix.platform.os }} | |
| strategy: | |
| matrix: | |
| # Keep in sync with: | |
| # - pyproject.toml | |
| # - dists.yml | |
| # - the rust_impl tests above | |
| # - the mypy checks below | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| platform: [ | |
| { os: "ubuntu-latest", python-target: "linux-x86_64", name: "ubuntu-x64" }, | |
| { os: "macos-15-intel", python-target: "macos-x86_64", name: "macos-x64" }, | |
| { os: "macos-latest", python-target: "macos-aarch64", name: "macos-arm64" }, | |
| { os: "windows-latest", python-target: "windows-x86", name: "windows-x86" }, | |
| { os: "windows-latest", python-target: "windows-x86_64", name: "windows-x64" }, | |
| ] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - run: uv venv --python cpython-${{ matrix.python-version }}-${{ matrix.platform.python-target }} | |
| - run: uv run tests/python_info.py | |
| - name: build the C extension | |
| run: uv run --with setuptools setup.py build | |
| working-directory: c_impl | |
| - run: git clean -dffx | |
| - name: build the C extension with FORCE_INTRINSICS | |
| run: uv run --with setuptools setup.py build | |
| working-directory: c_impl | |
| env: | |
| FORCE_INTRINSICS: "1" | |
| - run: git clean -dffx | |
| - name: install the C extension | |
| run: uv sync --no-install-project && uv pip install ./c_impl | |
| - name: test import, __version__, __file__ | |
| run: uv run --no-sync python -c "import blake3; print(blake3.__version__); print(blake3.__file__)" | |
| - name: Run pytest | |
| run: uv run --no-sync pytest --verbose | |
| mypy: | |
| name: "mypy" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # Keep in sync with: | |
| # - pyproject.toml | |
| # - dists.yml | |
| # - the rust_impl tests above | |
| # - the c_impl tests above | |
| python-version: ["3.8", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Run mypy | |
| run: uv run --python ${{ matrix.python-version }} --with mypy mypy --strict blake3.pyi tests/test_blake3.py |