| 1 | name: Rust |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - trying |
| 7 | - staging |
| 8 | pull_request: |
| 9 | |
| 10 | env: |
| 11 | CARGO_INCREMENTAL: 0 |
| 12 | RUST_TEST_THREADS: 1 |
| 13 | |
| 14 | jobs: |
| 15 | build_tier_one: |
| 16 | runs-on: ${{ matrix.os }}-latest |
| 17 | strategy: |
| 18 | matrix: |
| 19 | os: [ubuntu, macos, windows] |
| 20 | channel: [stable, beta, nightly] |
| 21 | feature: [arc_lock, serde, deadlock_detection] |
| 22 | include: |
| 23 | - channel: nightly |
| 24 | feature: nightly |
| 25 | os: ubuntu |
| 26 | - channel: nightly |
| 27 | feature: hardware-lock-elision |
| 28 | os: ubuntu |
| 29 | |
| 30 | steps: |
| 31 | - uses: actions/checkout@v4 |
| 32 | - run: rustup default ${{ matrix.channel }} |
| 33 | - run: cargo build --all |
| 34 | - run: cargo test --all |
| 35 | - run: cargo build --all --features ${{ matrix.feature }} |
| 36 | - run: cargo test --all --features ${{ matrix.feature }} |
| 37 | if: matrix.feature == 'nightly' |
| 38 | - run: cargo install cargo-msrv |
| 39 | - run: cargo msrv --workspace verify |
| 40 | build_other_platforms: |
| 41 | runs-on: ubuntu-latest |
| 42 | strategy: |
| 43 | matrix: |
| 44 | target: |
| 45 | - wasm32-unknown-unknown |
| 46 | - x86_64-fortanix-unknown-sgx |
| 47 | - x86_64-unknown-redox |
| 48 | - x86_64-linux-android |
| 49 | steps: |
| 50 | - uses: actions/checkout@v4 |
| 51 | - run: rustup default nightly |
| 52 | - run: rustup target add ${{ matrix.target }} |
| 53 | - run: cargo build --workspace --target ${{ matrix.target }} --features nightly |
| 54 | build_docs: |
| 55 | runs-on: ubuntu-latest |
| 56 | steps: |
| 57 | - uses: actions/checkout@v4 |
| 58 | - run: rustup default nightly |
| 59 | - run: cargo doc --workspace --features arc_lock,serde,deadlock_detection --no-deps -p parking_lot -p parking_lot_core -p lock_api |
| 60 | benchmark: |
| 61 | runs-on: ubuntu-latest |
| 62 | steps: |
| 63 | - uses: actions/checkout@v4 |
| 64 | - run: rustup default nightly |
| 65 | - run: | |
| 66 | cd benchmark |
| 67 | cargo run --release --bin mutex -- 2 1 0 1 2 |
| 68 | cargo run --release --bin rwlock -- 1 1 1 0 1 2 |