🦇 Fix CI (#2) #17
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
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| rust: | |
| name: Lint Rust code | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cargo fmt | |
| run: cargo fmt --all -- --check | |
| - name: Cargo clippy | |
| run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| # TODO(YIGIT): We currently do not have tests | |
| # - name: Cargo test | |
| # run: cargo test --workspace | |
| rust-msrv: | |
| name: Build-test MSRV (1.74) with minimal crate dependencies | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@nightly | |
| - name: Generate minimal-version dependencies | |
| run: cargo -Zminimal-versions generate-lockfile | |
| - name: Bump invalid dependencies | |
| # https://github.com/rust-lang/regex/pull/771/files | |
| run: cargo update -p regex-syntax --precise 0.6.25 | |
| - uses: dtolnay/rust-toolchain@1.74.0 | |
| - name: Cargo check | |
| run: cargo check --workspace --all-targets --all-features | |
| generate-rust: | |
| name: Generate Rust crate | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Checkout submodule | |
| # Manually update submodules with --checkout because they are configured with update=none and will be skipped otherwise | |
| run: git submodule update --recursive --init --force --checkout | |
| - name: Clean | |
| run: rm sys/src/**/*bindings.rs | |
| - name: Generate | |
| run: cargo r -p api_gen | |
| - name: Upload crate source | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: crate-source | |
| path: sys/src/**/*bindings.rs | |
| - name: Diff generated Rust code | |
| shell: bash | |
| run: | | |
| # Somehow bindgen seems to output LF on Windows, and that confuses our status checks which expect CRLF | |
| unix2dos sys/src/**/*bindings.rs | |
| test -z "$(git status --porcelain)" || (echo "::error::Generated files are different, please regenerate with 'cargo r -p api_gen'!"; git diff; false) |