Răsfoiți Sursa

ci: Add Rust and Asan flags (memory leaks, address sanitation) for tests

Pass some flags to test more aspects of rbpf in the CI. We cannot pass
those flags via the actions-rs/cargo Action, so we drop it for that
step. Actually, drop it everywhere, we can just as well run cargo
directly without having to pull another Action.

Suggested-by: Ben Kimock <kimockb@gmail.com>
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Quentin Monnet 2 ani în urmă
părinte
comite
c738e360d6
1 a modificat fișierele cu 13 adăugiri și 10 ștergeri
  1. 13 10
      .github/workflows/test.yaml

+ 13 - 10
.github/workflows/test.yaml

@@ -40,20 +40,23 @@ jobs:
           components: clippy
 
       - name: Build with ${{ matrix.toolchain }}
-        uses: actions-rs/cargo@v1
-        with:
-          command: build
-          args: --release --all-features --all-targets
+        run: |
+          cargo +${{ matrix.toolchain }} build \
+              --release --all-features --all-targets
 
       - name: Test with ${{ matrix.toolchain }}
-        uses: actions-rs/cargo@v1
-        with:
-          command: test
+        run: |
+          if [[ "${{ matrix.toolchain }}" == 'nightly' ]]; then
+              export RUSTDOCFLAGS='-Zsanitizer=address'
+              export RUSTFLAGS='-Zsanitizer=address'
+              export ASAN_OPTIONS='detect_leaks=1'
+          fi
+          cargo +${{ matrix.toolchain }} test \
+              --target=x86_64-unknown-linux-gnu
 
       - name: Lint with ${{ matrix.toolchain }}
-        uses: actions-rs/cargo@v1
-        with:
-          command: clippy
+        run: |
+          cargo +${{ matrix.toolchain }} clippy
 
       - name: Run BPF conformance tests - Interpreter
         run: |