From d25a88ab8a28eb34f515f111e85281c0dbe61a1a Mon Sep 17 00:00:00 2001 From: kuangjux <18630816527@163.com> Date: Wed, 15 May 2024 20:44:58 +0800 Subject: [PATCH] feat(ci): Add ci for test. --- .github/workflows/examples.yml | 2 +- .github/workflows/test.yml | 22 ++++++++++++++++++++++ tests/Cargo.toml | 4 ---- tests/block.rs | 33 --------------------------------- 4 files changed, 23 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 tests/block.rs diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index abfbcbb..bafec64 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -1,4 +1,4 @@ -name: Build CI +name: Run Example CI on: [push, pull_request] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4f38ef9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +name: Run Test CI + +on: [push, pull_request] + +jobs: + examples: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust-toolchain: [stable] + steps: + - uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust-toolchain }} + components: rust-src + override: true + - name: Check all tests + run: make test + diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 2e3d4f5..8ea4c21 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -9,10 +9,6 @@ edition = "2021" thriller_core = { path = "../thriller-core" } thriller_utils = { path = "../thriller-utils" } -[[test]] -name = "block" -path = "block.rs" - [[test]] name = "id" path = "id.rs" diff --git a/tests/block.rs b/tests/block.rs deleted file mode 100644 index a231376..0000000 --- a/tests/block.rs +++ /dev/null @@ -1,33 +0,0 @@ -use std::rc::Rc; - -use thriller_core::{ - initialize, AttachedEdge, BlockType, Buffer, MemoryLevel, Task, ThrillerBlock, ThrillerGraph, -}; - -#[test] -fn test_block() { - initialize(); - - let s_a = Rc::new(Buffer::new("sA")); - let r_a = Rc::new(Buffer::new("rA")); - let s_b = Rc::new(Buffer::new("sB")); - let r_b = Rc::new(Buffer::new("rB")); - let in_edge0 = AttachedEdge::new(s_a, r_a, None); - let in_edge1 = AttachedEdge::new(s_b, r_b, None); - - let acc = Rc::new(Buffer::new("acc")); - let s_c = Rc::new(Buffer::new("sC")); - let out_edge = AttachedEdge::new(acc, s_c, None); - - let block = ThrillerBlock::new( - vec![Rc::new(in_edge0), Rc::new(in_edge1)], - vec![Rc::new(out_edge)], - MemoryLevel::Register, - Rc::new(ThrillerGraph::new(MemoryLevel::Register)), - BlockType::Map, - ); - - let code = block.emit().unwrap(); - - println!("{}", code); -}