Clang-Tidy 17: modernize-loop-convert (#3833) #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -Wextra-semi: GCC < 10 does not have this. | |
# -Wunreachable-code: GCC no longer has this option. | |
name: LinuxGCC | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.ref }}-${{ github.head_ref }}-linux-gcc | |
cancel-in-progress: true | |
jobs: | |
# Build and install libamrex as AMReX CMake project | |
# Note: this is an intentional "minimal" build that does not enable (many) options | |
library: | |
name: [email protected] C++17 Release [lib] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies_gcc.sh 8 | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=20M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
mkdir build | |
cd build | |
cmake .. \ | |
-DAMReX_FORTRAN=ON \ | |
-DAMReX_PLOTFILE_TOOLS=ON \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DCMAKE_INSTALL_PREFIX=/tmp/my-amrex \ | |
-DCMAKE_C_COMPILER=$(which gcc-8) \ | |
-DCMAKE_CXX_COMPILER=$(which g++-8) \ | |
-DCMAKE_Fortran_COMPILER=$(which gfortran-8) \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
make -j 4 | |
make install | |
make test_install | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
export PATH=/tmp/my-amrex/bin:$PATH | |
which amrex_fcompare | |
ctest --output-on-failure | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build libamrex and all tests | |
tests_build_3D: | |
name: [email protected] C++17 3D Debug Fortran [tests] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -O1 -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} | |
# It's too slow with -O0 | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=400M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
cmake -S . -B build \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DAMReX_EB=ON \ | |
-DAMReX_ENABLE_TESTS=ON \ | |
-DAMReX_FORTRAN=ON \ | |
-DAMReX_SPACEDIM=3 \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
cmake --build build -j 4 | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ctest --test-dir build --output-on-failure | |
ccache -s | |
du -hs ~/.cache/ccache | |
tests_build_2D: | |
name: [email protected] C++17 2D Debug Fortran [tests] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -O1 -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} | |
# It's too slow with -O0 | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=300M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
cmake -S . -B build \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DAMReX_EB=ON \ | |
-DAMReX_ENABLE_TESTS=ON \ | |
-DAMReX_FORTRAN=ON \ | |
-DAMReX_SPACEDIM=2 \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
cmake --build build -j 4 | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ctest --test-dir build --output-on-failure | |
ccache -s | |
du -hs ~/.cache/ccache | |
tests_build_1D: | |
name: [email protected] C++17 1D Debug Fortran [tests] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -O1 -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} | |
# -Werror temporarily skipped until we have functional testing established | |
# It's too slow with -O0 | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=180M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
cmake -S . -B build \ | |
-DCMAKE_BUILD_TYPE=Debug \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DAMReX_EB=OFF \ | |
-DAMReX_ENABLE_TESTS=ON \ | |
-DAMReX_FORTRAN=ON \ | |
-DAMReX_SPACEDIM=1 \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
cmake --build build -j 4 | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ctest --test-dir build --output-on-failure | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build libamrex and all tests | |
tests_cxx20: | |
name: [email protected] C++20 OMP [tests] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies_gcc.sh 10 | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wextra-semi -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=260M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
mkdir build | |
cd build | |
cmake .. \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DAMReX_ASSERTIONS=ON \ | |
-DAMReX_TESTING=ON \ | |
-DAMReX_EB=OFF \ | |
-DAMReX_ENABLE_TESTS=ON \ | |
-DAMReX_BOUND_CHECK=ON \ | |
-DAMReX_FPE=ON \ | |
-DAMReX_FORTRAN=ON \ | |
-DAMReX_OMP=ON \ | |
-DCMAKE_CXX_STANDARD=20 \ | |
-DCMAKE_C_COMPILER=$(which gcc-10) \ | |
-DCMAKE_CXX_COMPILER=$(which g++-10) \ | |
-DCMAKE_Fortran_COMPILER=$(which gfortran-10) \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
make -j 4 | |
# Let's not use clang-tidy for this test because it wants to use C++20. | |
# ${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
# make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
# CLANG_TIDY=clang-tidy-12 \ | |
# CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ctest --output-on-failure | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build libamrex and all tests w/o MPI | |
tests-nonmpi: | |
name: [email protected] C++17 NOMPI [tests] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies_gcc.sh 8 | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=40M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
mkdir build | |
cd build | |
cmake .. \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DAMReX_ASSERTIONS=ON \ | |
-DAMReX_TESTING=ON \ | |
-DAMReX_BOUND_CHECK=ON \ | |
-DAMReX_FPE=ON \ | |
-DAMReX_EB=ON \ | |
-DAMReX_ENABLE_TESTS=ON \ | |
-DAMReX_FORTRAN=ON \ | |
-DAMReX_MPI=OFF \ | |
-DCMAKE_C_COMPILER=$(which gcc-8) \ | |
-DCMAKE_CXX_COMPILER=$(which g++-8) \ | |
-DCMAKE_Fortran_COMPILER=$(which gfortran-8) \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
make -j 4 | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ctest --output-on-failure | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build libamrex and all tests | |
tests-nofortran: | |
name: GNU@12 C++17 w/o Fortran [tests] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies_gcc.sh 12 | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 14 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
# | |
# /home/runner/work/amrex/amrex/Src/Base/AMReX_IntVect.H:194:92: error: array subscript -1 is below array bounds of ‘int [3]’ [-Werror=array-bounds] | |
# int& operator[] (int i) noexcept { BL_ASSERT(i>=0 && i < AMREX_SPACEDIM); return vect[i]; } | |
# | |
# inlined from ‘const amrex::MultiFab& amrex::EBFArrayBoxFactory::getVolFrac() const’ at /home/runner/work/amrex/amrex/Src/EB/AMReX_EBFabFactory.H:53:91, | |
# /usr/include/c++/12/bits/shared_ptr_base.h:1666:16: error: potential null pointer dereference [-Werror=null-dereference] | |
# | |
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wunreachable-code -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs -Wno-array-bounds -Wno-null-dereference"} | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=315M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
mkdir build | |
cd build | |
cmake .. \ | |
-DCMAKE_BUILD_TYPE=RelWithDebINfo \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DAMReX_ASSERTIONS=ON \ | |
-DAMReX_TESTING=ON \ | |
-DAMReX_BOUND_CHECK=ON \ | |
-DAMReX_FPE=ON \ | |
-DAMReX_EB=ON \ | |
-DAMReX_ENABLE_TESTS=ON \ | |
-DAMReX_FORTRAN=OFF \ | |
-DAMReX_FORTRAN=OFF \ | |
-DCMAKE_C_COMPILER=$(which gcc-12) \ | |
-DCMAKE_CXX_COMPILER=$(which g++-12) \ | |
-DCMAKE_CXX_STANDARD=17 \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
make -j 4 | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-14 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ctest --output-on-failure | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build 1D libamrex with configure | |
configure-1d: | |
name: [email protected] Release [configure 1D] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=100M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
./configure --dim 1 | |
make -j4 XTRA_CXXFLAGS=-fno-operator-names \ | |
CCACHE=ccache | |
make install | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build 3D libamrex with configure | |
configure-3d: | |
name: [email protected] Release [configure 3D] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 15 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=130M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
./configure --dim 3 --enable-eb yes --enable-xsdk-defaults yes | |
make -j4 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS=-fno-operator-names \ | |
CCACHE=ccache | |
make install | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-15 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build 3D libamrex with single precision and tiny profiler | |
configure-3d-single-tprof: | |
name: [email protected] Release [configure 3D] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=115M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
./configure --dim 3 --enable-eb no --enable-xsdk-defaults no --single-precision yes --single-precision-particles yes --enable-tiny-profile yes | |
make -j4 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS=-fno-operator-names \ | |
CCACHE=ccache | |
make install | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build 3D libamrex debug omp build with configure | |
configure-3d-omp-debug: | |
name: [email protected] OMP Debug [configure 3D] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=120M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
./configure --dim 3 --enable-eb yes --enable-xsdk-defaults yes --with-omp yes --debug yes | |
make -j4 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS=-fno-operator-names \ | |
CCACHE=ccache | |
make install | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build Tools/Plotfile | |
plotfile-tools: | |
name: GNU Plotfile Tools [tools] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=40M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
cd Tools/Plotfile | |
make -j4 USE_MPI=FALSE USE_OMP=FALSE WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS=-fno-operator-names \ | |
CCACHE=ccache | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ccache -s | |
du -hs ~/.cache/ccache | |
# Build libamrex and run all tests | |
tests_run: | |
name: [email protected] C++17 [tests] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
.github/workflows/dependencies/dependencies_clang-tidy.sh 12 | |
.github/workflows/dependencies/dependencies_ccache.sh | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
env: {CXXFLAGS: "-fno-operator-names -Werror -Wall -Wextra -Wpedantic -Wnull-dereference -Wfloat-conversion -Wshadow -Woverloaded-virtual -Wunreachable-code -Wnon-virtual-dtor -Wlogical-op -Wmisleading-indentation -Wduplicated-cond -Wduplicated-branches -Wmissing-include-dirs"} | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=30M | |
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy | |
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt | |
ccache -z | |
mkdir build | |
cd build | |
cmake .. \ | |
-DAMReX_OMP=ON \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DAMReX_ENABLE_TESTS=ON \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache | |
make -j 4 | |
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt | |
make -j4 -k -f clang-tidy-ccache-misses.mak \ | |
CLANG_TIDY=clang-tidy-12 \ | |
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" | |
ccache -s | |
du -hs ~/.cache/ccache | |
- name: Run tests | |
run: | | |
cd build | |
ctest --output-on-failure -R | |
test_hdf5: | |
name: [email protected] HDF5 I/O Test [tests] | |
runs-on: ubuntu-20.04 | |
env: | |
CXX: h5pcc | |
CC: h5cc | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/dependencies.sh | |
sudo apt-get install libhdf5-openmpi-dev | |
sudo apt-get install hdf5-tools | |
- name: Build & Test | |
run: | | |
cd Tests/HDF5Benchmark | |
export OLCF_HDF5_ROOT=/usr/lib/x86_64-linux-gnu/hdf5/openmpi | |
make -j 4 | |
mpirun -np 2 ./main3d.gnu.TPROF.MPI.ex ./inputs | |
h5dump -d "level_0/data:offsets=0" -s "1" -c "1" ./plt00000.h5 | |
h5dump -d "level_0/data:datatype=1" -s "1" -c "1" ./plt00000/particle0/particle0.h5 | |
save_pr_number: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Save PR number | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
run: | | |
echo $PR_NUMBER > pr_number.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: pr_number | |
path: pr_number.txt | |
retention-days: 1 |