name: Logic & Security Tests
on:
push:
branches: [ "main" ]
tags-ignore:
- '**'
pull_request:
branches: [ "main" ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_BUILD_JOBS: 2
jobs:
logic-parallel:
name: Logic Tests (Stable)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run Parallel Logic Tests
run: |
set +e
echo "Starting Parallel Logic Suite..."
# --- 1. NO_STD ---
(
export CARGO_TARGET_DIR="target_logic_nostd"
echo "[no_std] Running..."
cargo test --no-default-features --features "" > nostd.log 2>&1
) &
PID_NOSTD=$!
# --- 2. STD ONLY ---
(
export CARGO_TARGET_DIR="target_logic_std"
echo "[std] Running..."
cargo test --no-default-features --features "std" > std.log 2>&1
) &
PID_STD=$!
# --- 3. ALL FEATURES (Serde) ---
(
export CARGO_TARGET_DIR="target_logic_all"
echo "[all-features] Running..."
cargo test --all-features > all.log 2>&1
) &
PID_ALL=$!
# --- WAIT AND REPORT ---
FAILED=0
wait $PID_NOSTD
if [ $? -ne 0 ]; then echo "[no_std] FAILED. Logs:"; cat nostd.log; FAILED=1; else echo "[no_std] PASSED"; fi
wait $PID_STD
if [ $? -ne 0 ]; then echo "[std] FAILED. Logs:"; cat std.log; FAILED=1; else echo "[std] PASSED"; fi
wait $PID_ALL
if [ $? -ne 0 ]; then echo "[all-features] FAILED. Logs:"; cat all.log; FAILED=1; else echo "[all-features] PASSED"; fi
if [ $FAILED -ne 0 ]; then exit 1; fi
set -e
echo "All Logic tests passed!"
- name: Cleanup Logs
if: always()
run: rm -f *.log
security-msan:
name: MemorySanitizer (Nightly)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run MSan (Full Features)
run: |
RUSTFLAGS="-Z sanitizer=memory" cargo test -Z build-std \
--target x86_64-unknown-linux-gnu \
--all-features \
--lib \
--tests