-
Notifications
You must be signed in to change notification settings - Fork 1.5k
92 lines (86 loc) · 2.55 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Check Rust
on:
push:
paths-ignore:
- "doc/**"
pull_request:
paths-ignore:
- "doc/**"
permissions:
contents: read # to fetch code (actions/checkout)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check-rust:
name: Check Rust
runs-on: ubuntu-latest
container: almalinux:9
steps:
- name: Cache rust
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
with:
path: ~/.cargo
key: check-rust
- name: Install system packages
run: |
dnf -y install dnf-plugins-core
dnf config-manager --set-enabled crb
dnf -y install \
autoconf \
automake \
cargo-vendor \
diffutils \
numactl-devel \
dpdk-devel \
file-devel \
gcc \
gcc-c++ \
git \
jansson-devel \
jq \
libtool \
libyaml-devel \
libnfnetlink-devel \
libnetfilter_queue-devel \
libnet-devel \
libcap-ng-devel \
libevent-devel \
libmaxminddb-devel \
libpcap-devel \
libtool \
lz4-devel \
make \
pcre2-devel \
pkgconfig \
python3-devel \
python3-sphinx \
python3-yaml \
sudo \
which \
zlib-devel
- name: Installing Rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install cbindgen
run: cargo install --debug cbindgen
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- run: git config --global --add safe.directory /__w/suricata/suricata
- run: ./scripts/bundle.sh
- run: ./autogen.sh
- run: ./configure --enable-warnings
- run: cargo clippy --all-features --fix --allow-no-vcs
working-directory: rust
- run: |
diff=$(git diff)
if [ "${diff}" ]; then
echo "${diff}"
echo "::error ::Clippy --fix made changes, please fix"
exit 1
fi
- run: cargo clippy --all-features --all-targets
working-directory: rust
# especially without debug feature
- run: cargo clippy
working-directory: rust