|
| 1 | +# Copied from https://github.com/rerun-io/rerun_template |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - "main" |
| 6 | + pull_request: |
| 7 | + types: [ opened, synchronize ] |
| 8 | + |
| 9 | +name: Rust |
| 10 | + |
| 11 | +env: |
| 12 | + RUSTFLAGS: -D warnings |
| 13 | + RUSTDOCFLAGS: -D warnings |
| 14 | + |
| 15 | +jobs: |
| 16 | + rust-check: |
| 17 | + name: Rust |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 23 | + with: |
| 24 | + components: rust-docs, clippy, rustfmt |
| 25 | + toolchain: 1.96.0 |
| 26 | + override: true |
| 27 | + |
| 28 | + - uses: prefix-dev/setup-pixi@v0.8.8 |
| 29 | + with: |
| 30 | + pixi-version: v0.77.1 |
| 31 | + |
| 32 | + - name: Rustfmt |
| 33 | + run: pixi run cargo fmt --all -- --check |
| 34 | + |
| 35 | + - name: check --all-features |
| 36 | + run: pixi run cargo check --all-features --all-targets |
| 37 | + |
| 38 | + - name: check default features |
| 39 | + run: pixi run cargo check --all-targets |
| 40 | + |
| 41 | + - name: check --no-default-features |
| 42 | + run: pixi run cargo check --no-default-features --all-targets |
| 43 | + |
| 44 | + # No doc-tests: the one crate is a staticlib, which has no lib target to run them in. |
| 45 | + |
| 46 | + - name: cargo doc --lib |
| 47 | + run: pixi run cargo doc --lib --no-deps --all-features |
| 48 | + |
| 49 | + - name: cargo doc --document-private-items |
| 50 | + run: pixi run cargo doc --document-private-items --no-deps --all-features |
| 51 | + |
| 52 | + - name: Build tests |
| 53 | + run: pixi run cargo build --tests --all-features |
| 54 | + |
| 55 | + - name: Run test |
| 56 | + run: pixi run cargo test --all-features |
| 57 | + |
| 58 | + - name: Clippy |
| 59 | + run: pixi run cargo clippy --all-targets --all-features -- -D warnings |
| 60 | + |
| 61 | + # --------------------------------------------------------------------------- |
| 62 | + |
| 63 | + # --------------------------------------------------------------------------- |
| 64 | + |
| 65 | + cargo-deny: |
| 66 | + name: Check Rust dependencies (cargo-deny) |
| 67 | + runs-on: ubuntu-latest |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v3 |
| 70 | + - uses: EmbarkStudios/cargo-deny-action@v2 |
| 71 | + with: |
| 72 | + rust-version: "1.96.0" |
| 73 | + log-level: warn |
| 74 | + command: check |
0 commit comments