Skip to content

Commit abcace8

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 abcace8

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-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: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Install Deps
23+
run: |
24+
sudo apt-get update;
25+
sudo apt-get install -y \
26+
automake \
27+
autoconf \
28+
libtool \
29+
autogen \
30+
bison \
31+
flex \
32+
libgmp3-dev \
33+
libmpfr-dev \
34+
libmpc-dev \
35+
build-essential \
36+
gcc-multilib \
37+
g++-multilib \
38+
bear \
39+
dejagnu;
40+
# install Rust directly using rustup
41+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;
42+
43+
- name: Make Source Read-Only
44+
run: chmod -R a-w ./*
45+
46+
- name: Configure
47+
run: |
48+
mkdir -p gccrs-build;
49+
cd gccrs-build;
50+
../configure \
51+
--enable-languages=rust \
52+
--disable-bootstrap \
53+
--enable-multilib
54+
55+
- name: Build
56+
shell: bash
57+
run: |
58+
cd gccrs-build; \
59+
# Add cargo to our path quickly
60+
. "$HOME/.cargo/env";
61+
bear -- make -Otarget -j $(nproc) 2>&1 | tee log
62+
- uses: actions/upload-artifact@v4
63+
with:
64+
name: compilation-database
65+
path: gccrs-build/compile_commands.json
66+
67+
68+
cland-tidy:
69+
needs: compilation-database
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-latest
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+
88+
include-what-you-use:
89+
needs: compilation-database
90+
env:
91+
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
92+
LC_ALL: C.UTF-8
93+
runs-on: ubuntu-latest
94+
steps:
95+
- name: Install Deps
96+
run: |
97+
sudo apt-get update;
98+
sudo apt-get install -y \
99+
iwyu
100+
101+
- uses: actions/download-artifact@v4
102+
with:
103+
name: compilation-database
104+
path: db
105+
- run: |
106+
iwyu_tool.py -p db/compile-commands.json gcc/rust/

0 commit comments

Comments
 (0)