Merge branch 'main' into main #1
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: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| paths: | |
| - 'chipcompiler/**' | |
| - 'test/**' | |
| - 'pyproject.toml' | |
| - 'BUILD.bazel' | |
| - '.bazelversion' | |
| - 'bazel/**' | |
| - 'MODULE.bazel' | |
| - '.github/workflows/ci.yml' | |
| - '.github/workflows/release.yml' | |
| - '.github/workflows/auto-tag.yml' | |
| - '.github/actions/**' | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| UV_PYTHON_PREFERENCE: only-managed | |
| jobs: | |
| check-version: | |
| name: Check Version Consistency | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Check version | |
| uses: ./.github/actions/check-version | |
| test: | |
| name: Test | |
| needs: check-version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Python dependencies | |
| uses: ./.github/actions/setup-python-deps | |
| - name: Setup PDK | |
| run: | | |
| git clone --depth 1 https://github.com/openecos-projects/icsprout55-pdk.git chipcompiler/thirdparty/icsprout55-pdk | |
| cd chipcompiler/thirdparty/icsprout55-pdk && make unzip | |
| - name: Setup OSS CAD Suite | |
| uses: YosysHQ/setup-oss-cad-suite@v4 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Verify Yosys | |
| run: | | |
| yosys -V | |
| yosys -p "plugin -i slang" | |
| # - name: Ruff format check | |
| # run: uv run ruff format --check chipcompiler test | |
| # - name: Ruff lint | |
| # run: uv run ruff check chipcompiler test | |
| # - name: Pyright | |
| # run: uv run pyright chipcompiler | |
| - name: Pytest | |
| run: uv run pytest test/ --ignore=test/test_harden.py --cov=chipcompiler --cov-report= | |
| - name: Publish coverage summary | |
| if: always() | |
| run: | | |
| { | |
| echo '## Coverage Report' | |
| echo '```' | |
| uv run coverage report | |
| echo '```' | |
| } >> $GITHUB_STEP_SUMMARY | |
| build-wheel: | |
| name: Build | |
| needs: check-version | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Python dependencies | |
| uses: ./.github/actions/setup-python-deps | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@0.14.0 | |
| with: | |
| bazelisk-version: "1.27.0" | |
| bazelisk-cache: true | |
| disk-cache: ${{ github.workflow }} | |
| repository-cache: true | |
| - name: Smoke test native toolchain wheels | |
| run: | | |
| .venv/bin/python - <<'PY' | |
| import ecc_tools_bin.ecc_py # noqa: F401 | |
| from dreamplace.Params import Params # noqa: F401 | |
| from dreamplace.Placer import PlacementEngine # noqa: F401 | |
| print("ecc-tools and ecc-dreamplace imports passed") | |
| PY | |
| - name: Build distributable wheel | |
| run: bazel run //:build_wheel | |
| - name: Upload wheel artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ecc-wheel | |
| if-no-files-found: ignore | |
| path: | | |
| dist/wheel/repaired/*.whl |