Skip to content

Commit 1d4e91a

Browse files
authored
ci/Vulnerabilities checker (#964)
* ci: Add vulnerabilities checker * Fix * Fix * Fix * More options * Schedule vulnerabilities * Remove
1 parent 03af140 commit 1d4e91a

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed

.github/workflows/vulnerabilities.yml

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: vulnerabilities
2+
3+
on:
4+
schedule:
5+
- cron: '0 21 * * TUE' # Run every Tuesday at 21:00 (UTC)
6+
push:
7+
tags:
8+
- 'v*.*.*'
9+
10+
jobs:
11+
12+
valgrind:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install llvmpipe and lavapipe
20+
run: |
21+
sudo apt-get update -y -qq
22+
sudo add-apt-repository ppa:kisak/kisak-mesa -y
23+
sudo apt-get update
24+
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
25+
26+
- name: Install valgrind
27+
run: |
28+
sudo apt-get install valgrind
29+
30+
- name: Run cargo-valgrind
31+
env:
32+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: "valgrind -s --leak-check=full --show-leak-kinds=all --error-exitcode=1"
33+
# Looking for vulnerabilities
34+
run: |
35+
cargo test
36+
37+
cargo-careful:
38+
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Install Rust nightly
45+
uses: dtolnay/rust-toolchain@nightly
46+
with:
47+
toolchain: nightly
48+
components: rustfmt, rust-src
49+
50+
- name: Install llvmpipe and lavapipe
51+
run: |
52+
sudo apt-get update -y -qq
53+
sudo add-apt-repository ppa:kisak/kisak-mesa -y
54+
sudo apt-get update
55+
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
56+
57+
- name: Install cargo-careful
58+
env:
59+
CAREFUL_LINK: https://github.com/RalfJung/cargo-careful/releases/download
60+
CAREFUL_VERSION: 0.4.0
61+
run: |
62+
curl -L "$CAREFUL_LINK/v$CAREFUL_VERSION/cargo-careful.x86_64-unknown-linux-musl" \
63+
--output $HOME/.cargo/bin/cargo-careful
64+
chmod +x $HOME/.cargo/bin/cargo-careful
65+
66+
- name: Run cargo-careful
67+
# Looking for undefined behaviours
68+
run: cargo +nightly careful test
69+
70+
address-sanitizer:
71+
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- uses: actions/checkout@v4
76+
77+
- name: Install Rust nightly
78+
uses: dtolnay/rust-toolchain@nightly
79+
with:
80+
toolchain: nightly
81+
components: rustfmt, rust-src
82+
83+
- name: Install llvmpipe and lavapipe
84+
run: |
85+
sudo apt-get update -y -qq
86+
sudo add-apt-repository ppa:kisak/kisak-mesa -y
87+
sudo apt-get update
88+
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
89+
90+
- name: Run AddressSanitizer
91+
env:
92+
RUSTFLAGS: -Zsanitizer=address -Copt-level=3
93+
RUSTDOCFLAGS: -Zsanitizer=address
94+
# Looking for memory vulnerabilities
95+
run: cargo test -Zbuild-std --target x86_64-unknown-linux-gnu -- --nocapture
96+
97+
thread-sanitizer:
98+
99+
runs-on: ubuntu-latest
100+
101+
steps:
102+
- uses: actions/checkout@v4
103+
104+
- name: Install Rust nightly
105+
uses: dtolnay/rust-toolchain@nightly
106+
with:
107+
toolchain: nightly
108+
components: rustfmt, rust-src
109+
110+
- name: Install llvmpipe and lavapipe
111+
run: |
112+
sudo apt-get update -y -qq
113+
sudo add-apt-repository ppa:kisak/kisak-mesa -y
114+
sudo apt-get update
115+
sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
116+
117+
- name: Run ThreadSanitizer
118+
env:
119+
RUSTFLAGS: -Zsanitizer=thread -Copt-level=3
120+
RUSTDOCFLAGS: -Zsanitizer=thread
121+
# Looking for data race among threads
122+
run: cargo test -Zbuild-std --target x86_64-unknown-linux-gnu -- --nocapture

0 commit comments

Comments
 (0)