fix(python): import ArchSpec from canonical path in test_bytecode #892
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 | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "00 01 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| rust: | |
| name: Rust tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: extractions/setup-just@v3 | |
| - name: Install cargo-llvm-cov | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: Run tests with coverage | |
| run: just coverage-rust | |
| - name: Upload Rust coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: rust-coverage.xml | |
| flags: rust | |
| fail_ci_if_error: true | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| smoke: | |
| name: Smoke tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Test | |
| run: ./scripts/test_smoke.sh | |
| c-ffi: | |
| name: C-FFI integration tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: extractions/setup-just@v3 | |
| - name: Verify header freshness and syntax | |
| run: just check-header | |
| - name: Build and run C smoke test | |
| run: just test-c-ffi | |
| python-fast: | |
| name: Python fast tests (${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.5.1" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install the project | |
| run: uv sync --all-extras --dev | |
| - name: Run fast tests | |
| run: uv run pytest python/tests -m "not slow" -v | |
| build: | |
| name: build (${{ matrix.python-version }}) | |
| needs: python-fast | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.5.1" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install the project | |
| run: uv sync --all-extras --dev | |
| - name: Run all tests with coverage | |
| run: uv run just coverage | |
| - name: Upload Python coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage.xml | |
| flags: python | |
| fail_ci_if_error: true | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Archive code coverage results | |
| if: matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: code-coverage-report | |
| path: coverage.xml | |
| retention-days: 2 | |
| demo: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.5.1" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install the project | |
| run: uv sync --all-extras --dev | |
| - name: Run demos | |
| run: uv run just demo | |
| post: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.event.pull_request | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: download coverage | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: code-coverage-report | |
| - name: check coverage | |
| run: | | |
| if [ -f coverage.xml ]; then | |
| echo "Coverage file exists" | |
| else | |
| echo "Coverage file does not exist" | |
| exit 1 | |
| fi | |
| - name: post coverage | |
| uses: orgoro/coverage@v3.2 | |
| with: | |
| coverageFile: coverage.xml | |
| token: ${{ secrets.GITHUB_TOKEN }} |