Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some additional tools to the CI #3275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checks: '-*,bugprone-*,clang-analyzer-*,misc-*,performance-*,readability-*,portability-*,modernize-*,cppcoreguidelines-*'
106 changes: 106 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Additional lint

on:
push:
branches:
- trying
- staging
pull_request:
branches: [ master ]
merge_group:

jobs:
compilation-database:
env:
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can probably go away

LC_ALL: C.UTF-8

runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: Install Deps
run: |
sudo apt-get update;
sudo apt-get install -y \
automake \
autoconf \
libtool \
autogen \
bison \
flex \
libgmp3-dev \
libmpfr-dev \
libmpc-dev \
build-essential \
gcc-multilib \
g++-multilib \
bear \
dejagnu;
# install Rust directly using rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.72.0;

- name: Make Source Read-Only
run: chmod -R a-w ./*

- name: Configure
run: |
mkdir -p gccrs-build;
cd gccrs-build;
../configure \
--enable-languages=rust \
--disable-bootstrap \
--enable-multilib

- name: Build
shell: bash
run: |
cd gccrs-build; \
# Add cargo to our path quickly
. "$HOME/.cargo/env";
bear -- make -j1 2>&1 | tee log
- uses: actions/upload-artifact@v4
with:
name: compilation-database
path: gccrs-build/compile_commands.json


cland-tidy:
needs: compilation-database
env:
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
LC_ALL: C.UTF-8
runs-on: ubuntu-latest
steps:
- name: Install Deps
run: |
sudo apt-get update;
sudo apt-get install -y \
clang-tools

- uses: actions/download-artifact@v4
with:
name: compilation-database
path: db
- run: |
run-clang-tidy -p db/compile-commands.json -style .github/clang-tidy.yml gcc/rust/*

include-what-you-use:
needs: compilation-database
env:
# Force locale, in particular for reproducible results re '.github/log_expected_warnings' (see below).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto 😬

LC_ALL: C.UTF-8
runs-on: ubuntu-latest
steps:
- name: Install Deps
run: |
sudo apt-get update;
sudo apt-get install -y \
iwyu

- uses: actions/download-artifact@v4
with:
name: compilation-database
path: db
- run: |
iwyu_tool.py -p db/compile-commands.json gcc/rust/
Loading