Эх сурвалжийг харах

chore(ci): run the slowest loom models in separate jobs (#21)

Eliza Weisman 3 жил өмнө
parent
commit
299011398b

+ 37 - 0
.github/workflows/loom.yml

@@ -19,6 +19,42 @@ env:
   RUSTFLAGS: "--cfg loom"
 
 jobs:
+  loom_mpsc_send_recv_wrap:
+    name: "mpsc_send_recv_wrap"
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Install stable toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: stable
+          override: true
+          components: rustfmt
+      - name: Run cargo test
+        uses: actions-rs/cargo@v1
+        with:
+          command: test
+          args: --profile loom --lib -- mpsc_send_recv_wrap
+
+  loom_mpsc_try_send_recv:
+    name: "mpsc_try_send_recv"
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Install stable toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          profile: minimal
+          toolchain: stable
+          override: true
+          components: rustfmt
+      - name: Run cargo test
+        uses: actions-rs/cargo@v1
+        with:
+          command: test
+          args: --profile loom --lib -- mpsc_try_send_recv
+
   loom_mpsc_async:
     name: "mpsc"
     runs-on: ubuntu-latest
@@ -36,6 +72,7 @@ jobs:
         with:
           command: test
           args: --profile loom --lib -- mpsc_async
+          RUSTFLAGS: "--cfg loom --cfg ci_skip_slow_models"
 
   loom_mpsc_sync:
     name: "mpsc::sync"

+ 2 - 0
src/mpsc/tests/mpsc_async.rs

@@ -5,6 +5,7 @@ use crate::{
 };
 
 #[test]
+#[cfg_attr(ci_skip_slow_models, ignore)]
 fn mpsc_try_send_recv() {
     loom::model(|| {
         let (tx, rx) = channel(ThingBuf::new(3));
@@ -169,6 +170,7 @@ fn spsc_send_recv_in_order_wrap() {
 }
 
 #[test]
+#[cfg_attr(ci_skip_slow_models, ignore)]
 fn mpsc_send_recv_wrap() {
     loom::model(|| {
         let (tx, rx) = channel(ThingBuf::<usize>::new(1));