Print any image in your terminal or text file lib.rs/crates/aarty
ascii ascii-art
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at aurora 70 lines 2.7 kB view raw
1# This workflow runs checks for unsafe code. In crates that don't have any unsafe code, this can be 2# removed. Runs: 3# - miri - detects undefined behavior and memory leaks 4# - address sanitizer - detects memory errors 5# - leak sanitizer - detects memory leaks 6# See check.yml for information about how the concurrency cancellation and workflow triggering works 7permissions: 8 contents: read 9on: 10 push: 11 branches: [aurora] 12 pull_request: 13concurrency: 14 group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 15 cancel-in-progress: true 16name: safety 17jobs: 18 sanitizers: 19 runs-on: ubuntu-latest 20 steps: 21 - uses: actions/checkout@v6 22 with: 23 submodules: true 24 - name: Install nightly 25 uses: dtolnay/rust-toolchain@nightly 26 - run: | 27 # to get the symbolizer for debug symbol resolution 28 sudo apt install llvm 29 # to fix buggy leak analyzer: 30 # https://github.com/japaric/rust-san#unrealiable-leaksanitizer 31 # ensure there's a profile.dev section 32 if ! grep -qE '^[ \t]*[profile.dev]' Cargo.toml; then 33 echo >> Cargo.toml 34 echo '[profile.dev]' >> Cargo.toml 35 fi 36 # remove pre-existing opt-levels in profile.dev 37 sed -i '/^\s*\[profile.dev\]/,/^\s*\[/ {/^\s*opt-level/d}' Cargo.toml 38 # now set opt-level to 1 39 sed -i '/^\s*\[profile.dev\]/a opt-level = 1' Cargo.toml 40 cat Cargo.toml 41 name: Enable debug symbols 42 - name: cargo test -Zsanitizer=address 43 # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 44 run: cargo test --lib --tests --all-features --target x86_64-unknown-linux-gnu 45 env: 46 ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" 47 RUSTFLAGS: "-Z sanitizer=address" 48 - name: cargo test -Zsanitizer=leak 49 if: always() 50 run: cargo test --all-features --target x86_64-unknown-linux-gnu 51 env: 52 LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" 53 RUSTFLAGS: "-Z sanitizer=leak" 54 miri: 55 runs-on: ubuntu-latest 56 steps: 57 - uses: actions/checkout@v6 58 with: 59 submodules: true 60 - run: | 61 echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV 62 - name: Install ${{ env.NIGHTLY }} 63 uses: dtolnay/rust-toolchain@master 64 with: 65 toolchain: ${{ env.NIGHTLY }} 66 components: miri 67 - name: cargo miri test 68 run: cargo miri test 69 env: 70 MIRIFLAGS: ""