From a3d922538ba95a6d985f70d4db49c441534f97d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=9A=D0=BE=D1=82=D0=BB?= =?UTF-8?q?=D1=8F=D1=80=D0=BE=D0=B2?= Date: Wed, 8 May 2024 00:25:09 +0300 Subject: [PATCH] 1. Add CI --- .github/workflows/CI.yml | 34 ++++++++++++++++++++++++++++++++++ examples/arr.rs | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..f6e21ba --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always + +jobs: + cargo-test: + strategy: + matrix: + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - uses: actions/checkout@v3 + - name: Run cargo deftest + run: cargo test --verbose + - name: Run cargo alltest + run: cargo test --all-features --verbose diff --git a/examples/arr.rs b/examples/arr.rs index 985b19e..ac455c1 100644 --- a/examples/arr.rs +++ b/examples/arr.rs @@ -3,6 +3,6 @@ use core::ffi::CStr; fn main() { let cstr = cstr!(b"Test Custom cstr"); - + assert_eq!(cstr.to_bytes_with_nul(), b"Test Custom cstr\0"); }