Add tests for Pyodide build with Pixi and uv #6127
Workflow file for this run
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: CI Jobs | |
| on: | |
| push: | |
| branches: [ main, 'stable/*' ] | |
| pull_request: | |
| branches: [ main, 'stable/*' ] | |
| merge_group: | |
| concurrency: | |
| group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_lint: | |
| if: github.repository_owner == 'Qiskit' | |
| name: Build, rustfmt, and python lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Print Concurrency Group | |
| env: | |
| CONCURRENCY_GROUP: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }} | |
| run: | | |
| echo -e "\033[31;1;4mConcurrency Group\033[0m" | |
| echo -e "$CONCURRENCY_GROUP\n" | |
| shell: bash | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: | | |
| pip install -U --group lint | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Test Build | |
| run: cargo build | |
| - name: Rust Format | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| - name: Black Codestyle Format | |
| run: black --check --diff rustworkx tests | |
| - name: Python Lint | |
| run: ruff check rustworkx setup.py tests | |
| - name: Check stray release notes | |
| run: python tools/find_stray_release_notes.py | |
| - name: rustworkx-core Rust Tests | |
| run: cargo test --workspace | |
| - name: rustworkx-core Docs | |
| run: cargo doc -p rustworkx-core | |
| env: | |
| RUSTDOCFLAGS: '-D warnings' | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: rustworkx_core_docs | |
| path: target/doc/rustworkx_core | |
| tests: | |
| if: github.repository_owner == 'Qiskit' | |
| needs: [build_lint] | |
| name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} ${{ matrix.msrv }} | |
| runs-on: ${{ matrix.platform.os }} | |
| strategy: | |
| matrix: | |
| rust: [stable] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| platform: [ | |
| { os: "macos-15-intel", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }, | |
| { os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }, | |
| { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }, | |
| { os: "ubuntu-24.04-arm", python-architecture: "arm64", rust-target: "aarch64-unknown-linux-gnu" }, | |
| { os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" }, | |
| ] | |
| include: | |
| # Test minimal supported Rust version | |
| - rust: 1.85.1 | |
| python-version: "3.12" | |
| platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" } | |
| msrv: "MSRV" | |
| # Test future versions of Rust and Python | |
| - rust: beta | |
| python-version: "3.14" # upgrade to 3.15-dev when the release candidate is available | |
| platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" } | |
| msrv: "Beta" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: ${{ matrix.platform.python-architecture }} | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| targets: ${{ matrix.platform.rust-target }} | |
| - name: 'Install dependencies' | |
| run: | | |
| python -m pip install -U --group testinfra | |
| - name: 'Install binary dependencies' | |
| run: sudo apt-get install -y graphviz | |
| if: runner.os == 'Linux' | |
| - name: 'Run tests' | |
| run: nox -e test | |
| tests_stubs: | |
| if: github.repository_owner == 'Qiskit' | |
| needs: [tests] | |
| name: python-stubs-${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: 'Install dependencies' | |
| run: | | |
| python -m pip install -U --group testinfra | |
| - name: 'Run rustworkx stub tests' | |
| run: nox -estubs | |
| coverage: | |
| if: github.repository_owner == 'Qiskit' | |
| needs: [tests] | |
| name: Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: llvm-tools-preview | |
| - name: Download grcov | |
| run: curl -L https://github.com/mozilla/grcov/releases/download/v0.8.7/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - | |
| - name: Install deps | |
| run: | | |
| pip install -U --group test | |
| - name: Build rustworkx | |
| run: pip install . | |
| env: | |
| SETUPTOOLS_RUST_CARGO_PROFILE: "dev" | |
| CARGO_INCREMENTAL: 0 | |
| RUSTFLAGS: "-Cinstrument-coverage" | |
| LLVM_PROFILE_FILE: "rustworkx-%p-%m.profraw" | |
| - name: Run tests | |
| run: cd tests && stestr run && cd .. | |
| env: | |
| LLVM_PROFILE_FILE: "rustworkx-%p-%m.profraw" | |
| - name: Run grcov | |
| run: | | |
| set -e | |
| mv tests/rustworkx*profraw . | |
| ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o ./coveralls.lcov | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coveralls.lcov | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| format: lcov | |
| file: ./coveralls.lcov | |
| docs: | |
| if: github.repository_owner == 'Qiskit' | |
| needs: [tests] | |
| name: Build Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install binary deps | |
| run: sudo apt-get install -y graphviz | |
| - name: Install deps | |
| run: | | |
| pip install -U --group testinfra | |
| - name: Build Docs | |
| run: nox -e docs | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: html_docs | |
| path: docs/build/html | |
| pyodide-build: | |
| if: github.repository_owner == 'Qiskit' | |
| needs: [tests] | |
| name: Pyodide Build + Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: prefix-dev/[email protected] | |
| with: | |
| manifest-path: pyproject.toml | |
| pixi-version: v0.61.0 | |
| environments: default | |
| - run: pixi run build_pyodide_and_test |