ci: format, clippy, and workspace check against stock servo #4
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
| # Stock-servo CI: format, lint, and type-check the crate against the pinned | |
| # Servo revision with no patches and no `patched-servo` feature — the | |
| # configuration every consumer gets by default, and the one that silently | |
| # broke when a patched-tree-only preference landed unguarded. The patched | |
| # configuration (servo-patches/ + `--features patched-servo`) is deliberately | |
| # not covered here; it needs patched servo/stylo checkouts and belongs in a | |
| # scheduled job, not the per-push path. | |
| # | |
| # The heavy step is compiling Servo's dependency graph (SpiderMonkey | |
| # included). `cargo check`/`clippy` avoid codegen and the cache keeps warm | |
| # runs to minutes, but expect the first run on a cold cache to take a while. | |
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| fmt: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --all --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 90 | |
| env: | |
| # Servo's build scripts are memory-hungry; keep rustc's own debuginfo | |
| # out of check artifacts. | |
| CARGO_PROFILE_DEV_DEBUG: 0 | |
| CARGO_PROFILE_DEV_INCREMENTAL: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Servo build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libdbus-1-dev libegl1-mesa-dev \ | |
| libfontconfig1-dev libfreetype6-dev libharfbuzz-dev libx11-dev \ | |
| libxkbcommon-x11-dev | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| # The same invocation the crate has always been validated with. | |
| - run: cargo clippy --lib -- -D warnings | |
| # The workspace includes examples/helloworld, which has broken before | |
| # (missing icon for generate_context!) — keep it compiling. | |
| - run: cargo check --workspace |