From 35f6c18498a4ce7fea5376be6174bd4d5416199c Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Thu, 23 Nov 2023 14:43:24 +0100 Subject: [PATCH 1/5] Adds basic CI that builds & tests with Cargo. --- .github/workflows/build-cargo.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/build-cargo.yml diff --git a/.github/workflows/build-cargo.yml b/.github/workflows/build-cargo.yml new file mode 100644 index 0000000..b91cd0e --- /dev/null +++ b/.github/workflows/build-cargo.yml @@ -0,0 +1,19 @@ +name: Build & Test with Cargo +on: [push, pull_request] +jobs: + build: + name: cargo build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo build --all + - run: cargo build --all --examples + test: + name: cargo test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo test --all + - run: cargo test --all --examples From d12ee3a1ed4cee521b43d468bc3a64b91ac19628 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Thu, 23 Nov 2023 14:50:02 +0100 Subject: [PATCH 2/5] Maybe does not like the name?. --- .github/workflows/{build-cargo.yml => cargo.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-cargo.yml => cargo.yml} (100%) diff --git a/.github/workflows/build-cargo.yml b/.github/workflows/cargo.yml similarity index 100% rename from .github/workflows/build-cargo.yml rename to .github/workflows/cargo.yml From 97f90185afa2b06029f122d22d54e58f40b460a9 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Thu, 23 Nov 2023 14:55:45 +0100 Subject: [PATCH 3/5] Also test bazel. --- .github/workflows/bazel.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/bazel.yml diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml new file mode 100644 index 0000000..69db911 --- /dev/null +++ b/.github/workflows/bazel.yml @@ -0,0 +1,15 @@ +name: Build & Test with Bazel +on: [push, pull_request] +jobs: + build: + name: cargo build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: bazelisk build ... + test: + name: cargo test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: bazelisk test ... From f909a1dc3b73c07fa542bdd5eff6c14873374732 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Thu, 23 Nov 2023 14:57:36 +0100 Subject: [PATCH 4/5] Fix testing for bazel. --- zvt/src/packets.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zvt/src/packets.rs b/zvt/src/packets.rs index 65f4831..e92d087 100644 --- a/zvt/src/packets.rs +++ b/zvt/src/packets.rs @@ -416,7 +416,7 @@ pub mod tests { use std::fs; pub fn get_bytes(name: &str) -> Vec { - let path_from_root = "rust/zvt/zvt/data/".to_string(); + let path_from_root = "zvt/data/".to_string(); let base_dir = match fs::metadata(&path_from_root) { Ok(_) => path_from_root, Err(_) => format!("data/"), From 4aafb155e5d07a9e3892d2ba17bd04e001ee407b Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Thu, 23 Nov 2023 15:03:49 +0100 Subject: [PATCH 5/5] Addressed reviewer comments. --- .github/workflows/bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 69db911..e294d7b 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -2,13 +2,13 @@ name: Build & Test with Bazel on: [push, pull_request] jobs: build: - name: cargo build + name: bazel build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: bazelisk build ... test: - name: cargo test + name: bazel test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4