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

[WIP] Clang-tidy CI tests: bump clang version from 15 to 18 #5182

Open
wants to merge 7 commits into
base: development
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 .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Checks: '
google-build-namespaces,
google-global-names-in-headers,
misc-*,
-misc-include-cleaner,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
modernize-*,
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
matrix:
dim: [1, 2, RZ, 3]
name: clang-tidy-${{ matrix.dim }}D
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 180
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang15.sh
.github/workflows/dependencies/clang18.sh
- name: set up cache
uses: actions/cache@v4
with:
Expand All @@ -36,8 +36,8 @@ jobs:
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
ccache -z

export CXX=$(which clang++-15)
export CC=$(which clang-15)
export CXX=$(which clang++-18)
export CC=$(which clang-18)

cmake -S . -B build_clang_tidy \
-DCMAKE_VERBOSE_MAKEFILE=ON \
Expand All @@ -55,7 +55,7 @@ jobs:

${{github.workspace}}/.github/workflows/source/makeMakefileForClangTidy.py --input ${{github.workspace}}/ccache.log.txt
make -j4 --keep-going -f clang-tidy-ccache-misses.mak \
CLANG_TIDY=clang-tidy-15 \
CLANG_TIDY=clang-tidy-18 \
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"

ccache -s
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/dependencies/clang17.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ sudo apt-get install -y \
ccache \
pkg-config

# ccache
$(dirname "$0")/ccache.sh

# Use clang 17
export CXX=$(which clang++-17)
export CC=$(which clang-17)
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/dependencies/clang18.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env bash
#
# Copyright 2024 The WarpX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Luca Fedeli

set -eu -o pipefail

# `man apt.conf`:
# Number of retries to perform. If this is non-zero APT will retry
# failed files the given number of times.
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries

# This dependency file is currently used within a docker container,
# which does not come (among others) with wget, xz-utils, curl, git,
# ccache, and pkg-config pre-installed.
sudo apt-get -qqq update
sudo apt-get install -y \
cmake \
clang-18 \
clang-tidy-18 \
libblas-dev \
libc++-18-dev \
libboost-math-dev \
libfftw3-dev \
libfftw3-mpi-dev \
libhdf5-openmpi-dev \
liblapack-dev \
libopenmpi-dev \
libomp-18-dev \
ninja-build \
wget \
xz-utils \
curl \
git \
ccache \
pkg-config

# ccache
$(dirname "$0")/ccache.sh

# Use clang 18
export CXX=$(which clang++-18)
export CC=$(which clang-18)

# cmake-easyinstall
#
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://raw.githubusercontent.com/ax3l/cmake-easyinstall/main/cmake-easyinstall
sudo chmod a+x /usr/local/bin/cmake-easyinstall
export CEI_SUDO="sudo"
export CEI_TMP="/tmp/cei"

# BLAS++ & LAPACK++
cmake-easyinstall \
--prefix=/usr/local \
git+https://github.com/icl-utk-edu/blaspp.git \
-Duse_openmp=OFF \
-Dbuild_tests=OFF \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_VERBOSE_MAKEFILE=ON

cmake-easyinstall \
--prefix=/usr/local \
git+https://github.com/icl-utk-edu/lapackpp.git \
-Duse_cmake_find_lapack=ON \
-Dbuild_tests=OFF \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_VERBOSE_MAKEFILE=ON
Loading