Skip to content

Commit 8522432

Browse files
committed
Add some additional tools to the CI
ChangeLog: * .github/workflows/lint.yml: New file. * .github/clang-tidy.yml: New file. Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
1 parent 7bdbcb7 commit 8522432

File tree

2 files changed

+105
-0
lines changed

2 files changed

+105
-0
lines changed

.github/clang-tidy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Checks: '-*'

.github/workflows/lint.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Additional lint
2+
3+
on:
4+
push:
5+
branches:
6+
- trying
7+
- staging
8+
pull_request:
9+
branches: [ master ]
10+
merge_group:
11+
12+
jobs:
13+
compilation-database:
14+
env:
15+
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
16+
LC_ALL: C.UTF-8
17+
18+
runs-on: ubuntu-24.10
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Deps
24+
run: |
25+
sudo apt-get update;
26+
sudo apt-get install -y \
27+
automake \
28+
autoconf \
29+
libtool \
30+
autogen \
31+
bison \
32+
flex \
33+
libgmp3-dev \
34+
libmpfr-dev \
35+
libmpc-dev \
36+
build-essential \
37+
gcc-multilib \
38+
g++-multilib \
39+
bear \
40+
dejagnu;
41+
# install Rust directly using rustup
42+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
43+
44+
- name: Make Source Read-Only
45+
run: chmod -R a-w ./*
46+
47+
- name: Configure
48+
run: |
49+
mkdir -p gccrs-build;
50+
cd gccrs-build;
51+
../configure \
52+
--enable-languages=rust \
53+
--disable-bootstrap \
54+
--enable-multilib
55+
56+
- name: Build
57+
shell: bash
58+
run: |
59+
cd gccrs-build; \
60+
# Add cargo to our path quickly
61+
. "$HOME/.cargo/env";
62+
bear -- make -Otarget -j $(nproc) 2>&1 | tee log
63+
- uses: actions/upload-artifact@v4
64+
with:
65+
name: compilation-database
66+
path: gccrs-build/compile_commands.json
67+
68+
69+
cland-tidy:
70+
env:
71+
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
72+
LC_ALL: C.UTF-8
73+
runs-on: ubuntu-24.10
74+
steps:
75+
- name: Install Deps
76+
run: |
77+
sudo apt-get update;
78+
sudo apt-get install -y \
79+
clang-tools
80+
81+
- uses: actions/download-artifact@v4
82+
with:
83+
name: compilation-database
84+
path: db
85+
- run: |
86+
run-clang-tidy -p db/compile-commands.json -style contrib/clang-format gcc/rust/*
87+
include-what-you-use:
88+
env:
89+
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
90+
LC_ALL: C.UTF-8
91+
runs-on: ubuntu-24.10
92+
steps:
93+
- name: Install Deps
94+
run: |
95+
sudo apt-get update;
96+
sudo apt-get install -y \
97+
iwyu
98+
99+
- uses: actions/download-artifact@v4
100+
with:
101+
name: compilation-database
102+
path: db
103+
- run: |
104+
iwyu_tool.py -p db/compile-commands.json gcc/rust/

0 commit comments

Comments
 (0)