summaryrefslogtreecommitdiff
path: root/.github/workflows/build-and-test.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build-and-test.yml')
-rw-r--r--.github/workflows/build-and-test.yml40
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 0000000..6aeb92a
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,40 @@
+name: Cargo build and test
+on: [pull_request, workflow_dispatch]
+env:
+ CARGO_TERM_COLOR: always
+ RUSTFLAGS: "--deny warnings "
+jobs:
+ build-and-test:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ rust: [stable, beta]
+ include:
+ - os: ubuntu-latest
+ rust: nightly
+ - os: ubuntu-latest
+ rust: 1.65.0
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Install Rust
+ uses: ATiltedTree/setup-rust@v1.0.4
+ with:
+ rust-version: ${{ matrix.rust }}
+
+ - name: Install cargo-hack
+ uses: taiki-e/install-action@cargo-hack
+
+ - name: Build
+ run: cargo build
+
+ - name: Test
+ run: cargo hack --feature-powerset test
+
+ - name: Test with artificial delay
+ run: RUSTFLAGS+="--cfg oneshot_test_delay" cargo hack --feature-powerset test
+
+ - name: Test with loom
+ run: RUSTFLAGS+="--cfg loom" LOOM_MAX_BRANCHES=100000 cargo hack --feature-powerset test --test sync --test loom