1name: Cargo build and test 2on: [pull_request, workflow_dispatch] 3env: 4 CARGO_TERM_COLOR: always 5 RUSTFLAGS: "--deny warnings " 6jobs: 7 build-and-test: 8 strategy: 9 matrix: 10 os: [ubuntu-latest, macos-latest, windows-latest] 11 rust: [stable, beta] 12 include: 13 - os: ubuntu-latest 14 rust: nightly 15 - os: ubuntu-latest 16 rust: 1.65.0 17 runs-on: ubuntu-latest 18 steps: 19 - name: Checkout repository 20 uses: actions/checkout@v3 21 22 - name: Install Rust 23 uses: ATiltedTree/setup-rust@v1.0.4 24 with: 25 rust-version: ${{ matrix.rust }} 26 27 - name: Install cargo-hack 28 uses: taiki-e/install-action@cargo-hack 29 30 - name: Build 31 run: cargo build 32 33 - name: Test 34 run: cargo hack --feature-powerset test 35 36 - name: Test with artificial delay 37 run: RUSTFLAGS+="--cfg oneshot_test_delay" cargo hack --feature-powerset test 38 39 - name: Test with loom 40 run: RUSTFLAGS+="--cfg loom" LOOM_MAX_BRANCHES=100000 cargo hack --feature-powerset test --test sync --test loom 41