MARBLES-CI #586
This file contains hidden or 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
| name: MARBLES-CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 5 * * 1" | |
| concurrency: | |
| group: ${{github.ref}}-${{github.head_ref}}-ci | |
| cancel-in-progress: true | |
| jobs: | |
| Formatting: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| - name: Check formatting | |
| uses: DoozyX/clang-format-lint-action@v0.20 | |
| with: | |
| source: './Source' | |
| exclude: '.' | |
| extensions: 'H,cpp' | |
| clangFormatVersion: 20 | |
| CPU-GNUmake: | |
| needs: Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup | |
| run: | | |
| echo "NPROCS=$(nproc)" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESSLEVEL=5" >> $GITHUB_ENV | |
| echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV | |
| echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV | |
| - name: Install Ccache | |
| run: | | |
| wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | |
| tar xvf ccache-4.8-linux-x86_64.tar.xz | |
| sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ | |
| - name: Set Up Ccache | |
| 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: TG | |
| working-directory: ./Build | |
| run: | | |
| echo "::add-matcher::.github/problem-matchers/gcc.json" | |
| set -eu -o pipefail | |
| ccache -z | |
| make -j ${{env.NPROCS}} COMP=llvm USE_CCACHE=TRUE USE_MPI=FALSE DEBUG=TRUE 2>&1 | tee -a build-output.txt | |
| - name: TG ccache report | |
| working-directory: ./Build | |
| run: | | |
| ccache -s | |
| du -hs ${HOME}/.cache/ccache | |
| - name: TG test | |
| working-directory: ./Build | |
| run: ./marbles3d.llvm.DEBUG.TPROF.ex ../Tests/test_files/tg/tg.inp max_step=2 amr.plt_int=-1 amr.chk_int=-1 | |
| - name: TG debug report | |
| working-directory: ./Build | |
| run: | | |
| egrep "warning:|error:" build-output.txt \ | |
| | egrep -v "Submodules/AMReX|GNUmakefile" \ | |
| | egrep -v "ld: warning:" | sort | uniq \ | |
| | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > warnings.txt | |
| cat warnings.txt | |
| export return=$(tail -n 1 warnings.txt | awk '{print $2}') | |
| exit ${return} | |
| - name: TG debug single precision build | |
| working-directory: ./Build | |
| run: | | |
| echo "::add-matcher::.github/problem-matchers/gcc.json" | |
| set -eu -o pipefail | |
| ccache -z | |
| make -j ${{env.NPROCS}} COMP=llvm USE_CCACHE=TRUE USE_MPI=FALSE DEBUG=TRUE PRECISION=FLOAT 2>&1 | tee -a build-output.txt | |
| - name: TG debug single precision ccache report | |
| working-directory: ./Build | |
| run: | | |
| ccache -s | |
| du -hs ${HOME}/.cache/ccache | |
| - name: TG debug single precision test | |
| working-directory: ./Build | |
| run: ./marbles3d.llvm.FLOAT.DEBUG.TPROF.ex ../Tests/test_files/tg/tg.inp max_step=2 amr.plt_int=-1 amr.chk_int=-1 | |
| - name: TG debug single precision report | |
| working-directory: ./Build | |
| run: | | |
| egrep "warning:|error:" build-output.txt \ | |
| | egrep -v "Submodules/AMReX|GNUmakefile" \ | |
| | egrep -v "ld: warning:" | sort | uniq \ | |
| | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > warnings.txt | |
| cat warnings.txt | |
| export return=$(tail -n 1 warnings.txt | awk '{print $2}') | |
| exit ${return} | |
| CPU-CMake: | |
| needs: Formatting | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, macos-latest] | |
| build_type: [Release, Debug] | |
| dimension: [2D, 3D] | |
| include: | |
| - os: macos-latest | |
| install_deps: brew install mpich automake ccache | |
| comp: llvm | |
| procs: $(sysctl -n hw.ncpu) | |
| ccache_cache: /Users/runner/Library/Caches/ccache | |
| - os: ubuntu-22.04 | |
| install_deps: sudo apt-get update && sudo apt-get install mpich libmpich-dev | |
| comp: gnu | |
| procs: $(nproc) | |
| ccache_cache: ~/.cache/ccache | |
| - build_type: Release | |
| ctest_args: -LE no_ci | |
| - build_type: Debug | |
| ctest_args: -LE no_ci | |
| - dimension: 2D | |
| spacedim: 2 | |
| - dimension: 3D | |
| spacedim: 3 | |
| exclude: | |
| - os: macos-latest | |
| build_type: Debug | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup | |
| run: | | |
| echo "NPROCS=${{matrix.procs}}" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESSLEVEL=5" >> $GITHUB_ENV | |
| echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV | |
| echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV | |
| cmake -E make_directory ${{runner.workspace}}/deps | |
| - name: Dependencies | |
| run: | | |
| ${{matrix.install_deps}} | |
| - name: Install Ccache | |
| run: | | |
| if [ "${RUNNER_OS}" != "macOS" ]; then | |
| wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | |
| tar xvf ccache-4.8-linux-x86_64.tar.xz | |
| sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ | |
| fi | |
| - name: Set Up Ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{matrix.ccache_cache}} | |
| key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.os}}-${{matrix.build_type}}-${{matrix.dimension}}-git-${{github.sha}} | |
| restore-keys: | | |
| ccache-${{github.workflow}}-${{github.job}}-${{matrix.os}}-${{matrix.build_type}}-${{matrix.dimension}}-git- | |
| - name: Configure | |
| run: | | |
| cmake -B${{runner.workspace}}/build-${{matrix.os}}-${{matrix.build_type}} \ | |
| -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install-${{matrix.os}}-${{matrix.build_type}} \ | |
| -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \ | |
| -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | |
| -DMARBLES_DIM:STRING=${{matrix.spacedim}} \ | |
| -DMARBLES_ENABLE_MPI:BOOL=ON \ | |
| -DMARBLES_TEST_WITH_FCOMPARE:BOOL=OFF \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ | |
| ${{github.workspace}} | |
| - name: Build | |
| run: | | |
| ccache -z | |
| cmake --build ${{runner.workspace}}/build-${{matrix.os}}-${{matrix.build_type}} \ | |
| --parallel ${{env.NPROCS}} 2>&1 | tee -a ${{runner.workspace}}/build-output.txt; \ | |
| - name: Ccache Report | |
| run: | | |
| ccache -s | |
| if [ "${RUNNER_OS}" != "macOS" ]; then | |
| du -hs ${HOME}/.cache/ccache | |
| fi | |
| - name: Report | |
| run: | | |
| echo "::add-matcher::.github/problem-matchers/gcc.json" | |
| egrep "warning:|error:" ${{runner.workspace}}/build-output.txt \ | |
| | egrep -v "Submodules/AMReX" \ | |
| | egrep -v "ld: warning:" | egrep -v "lto-wrapper: warning:" | sort | uniq \ | |
| | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > ${{runner.workspace}}/build-output-warnings.txt | |
| cat ${{runner.workspace}}/build-output-warnings.txt | |
| export return=$(tail -n 1 ${{runner.workspace}}/build-output-warnings.txt | awk '{print $2}') | |
| exit ${return} | |
| - name: Test | |
| run: | | |
| cd ${{runner.workspace}}/build-${{matrix.os}}-${{matrix.build_type}}; \ | |
| ctest -j ${{env.NPROCS}} ${{matrix.ctest_args}} --output-on-failure; \ | |
| GPU-Nvidia: | |
| name: GPU-CUDA | |
| needs: [Formatting, CPU-GNUmake] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| cuda_ver: [12.6] | |
| include: | |
| - cuda_ver: "12.6" | |
| cuda_pkg: 12-6 | |
| cuda_extra: libcurand-dev-12-6 cuda-cupti-dev-12-6 | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Dependencies | |
| run: | | |
| ${{github.workspace}}/Submodules/AMReX/.github/workflows/dependencies/ubuntu_free_disk_space.sh | |
| curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb | |
| sudo dpkg -i cuda-keyring_1.0-1_all.deb | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| cuda-command-line-tools-${{matrix.cuda_pkg}} \ | |
| cuda-compiler-${{matrix.cuda_pkg}} cuda-minimal-build-${{matrix.cuda_pkg}} \ | |
| cuda-nvml-dev-${{matrix.cuda_pkg}} cuda-nvtx-${{matrix.cuda_pkg}} \ | |
| libcurand-dev-${{matrix.cuda_pkg}} cuda-cupti-dev-${{matrix.cuda_pkg}} \ | |
| libcusolver-dev-${{matrix.cuda_pkg}} libcusparse-dev-${{matrix.cuda_pkg}} \ | |
| libcublas-dev-${{matrix.cuda_pkg}} | |
| - name: Install Ccache | |
| run: | | |
| wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | |
| tar xvf ccache-4.8-linux-x86_64.tar.xz | |
| sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ | |
| - name: Set Up Ccache | |
| 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: Configure | |
| run: | | |
| export PATH=/usr/local/nvidia/bin:/usr/local/cuda-${{matrix.cuda_ver}}/bin:${PATH} | |
| export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH} | |
| cmake -Bbuild-${{matrix.cuda_pkg}} \ | |
| -DCMAKE_BUILD_TYPE:STRING=Release \ | |
| -DMARBLES_DIM:STRING=3 \ | |
| -DMARBLES_ENABLE_MPI:BOOL=OFF \ | |
| -DMARBLES_ENABLE_CUDA:BOOL=ON \ | |
| -DAMReX_CUDA_ERROR_CAPTURE_THIS:BOOL=ON \ | |
| -DCMAKE_CUDA_ARCHITECTURES:STRING=70 \ | |
| -DCMAKE_CUDA_COMPILER_LAUNCHER:STRING=ccache \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ | |
| ${{github.workspace}} | |
| - name: Build | |
| run: | | |
| ccache -z | |
| cmake --build build-${{matrix.cuda_pkg}} --parallel 1 | |
| - name: Ccache Report | |
| run: | | |
| ccache -s | |
| du -hs ${HOME}/.cache/ccache | |
| GPU-AMD: | |
| name: GPU-HIP | |
| needs: [Formatting, CPU-GNUmake] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup | |
| run: | | |
| echo "NPROCS=$(nproc)" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESSLEVEL=5" >> $GITHUB_ENV | |
| echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV | |
| echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV | |
| - name: Dependencies | |
| run: | | |
| ${{github.workspace}}/Submodules/AMReX/.github/workflows/dependencies/ubuntu_free_disk_space.sh | |
| sudo mkdir --parents --mode=0755 /etc/apt/keyrings | |
| wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null | |
| echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.3.3 noble main" | sudo tee --append /etc/apt/sources.list.d/rocm.list | |
| echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 | |
| echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' | sudo tee -a /etc/profile.d/rocm.sh | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends build-essential rocm-dev rocrand-dev rocprim-dev hiprand-dev | |
| - name: Install Ccache | |
| run: | | |
| wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | |
| tar xvf ccache-4.8-linux-x86_64.tar.xz | |
| sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ | |
| - name: Set Up Ccache | |
| 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: Configure | |
| run: | | |
| source /etc/profile.d/rocm.sh | |
| which clang | |
| which hipcc | |
| cmake -B${{runner.workspace}}/build-hip \ | |
| -DCMAKE_BUILD_TYPE:STRING=Release \ | |
| -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | |
| -DCMAKE_CXX_COMPILER:STRING=$(which hipcc) \ | |
| -DCMAKE_C_COMPILER:STRING=$(which clang) \ | |
| -DCMAKE_CXX_STANDARD:STRING=17 \ | |
| -DMARBLES_DIM:STRING=3 \ | |
| -DMARBLES_ENABLE_MPI:BOOL=OFF \ | |
| -DMARBLES_ENABLE_HIP:BOOL=ON \ | |
| -DAMReX_AMD_ARCH:STRING=gfx90a \ | |
| -DCMAKE_HIP_ARCHITECTURES:STRING=gfx90a \ | |
| -DAMDGPU_TARGETS:STRING=gfx90a \ | |
| -DGPU_TARGETS:STRING=gfx90a \ | |
| -DAMReX_GPU_RDC:BOOL=OFF \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ | |
| ${{github.workspace}} | |
| - name: Build | |
| run: | | |
| echo "::add-matcher::.github/problem-matchers/gcc.json" | |
| source /etc/profile.d/rocm.sh | |
| ccache -z | |
| cmake --build ${{runner.workspace}}/build-hip --parallel ${{env.NPROCS}} | |
| - name: Ccache Report | |
| run: | | |
| ccache -s | |
| du -hs ${HOME}/.cache/ccache | |
| GPU-Intel: | |
| name: GPU-SYCL | |
| needs: [Formatting, CPU-GNUmake] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup | |
| run: | | |
| echo "NPROCS=$(nproc)" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESSLEVEL=5" >> $GITHUB_ENV | |
| echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV | |
| echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV | |
| echo "CCACHE_DEPEND=1" >> $GITHUB_ENV | |
| - name: Dependencies | |
| run: | | |
| ${{github.workspace}}/Submodules/AMReX/.github/workflows/dependencies/ubuntu_free_disk_space.sh | |
| sudo wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| echo "deb https://apt.repos.intel.com/oneapi all main" \ | |
| | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
| sudo apt-get update | |
| sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel | |
| - name: Install Ccache | |
| run: | | |
| wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | |
| tar xvf ccache-4.8-linux-x86_64.tar.xz | |
| sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ | |
| - name: Set Up Ccache | |
| 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: Configure | |
| run: | | |
| set +e | |
| source /opt/intel/oneapi/setvars.sh | |
| set -e | |
| cmake -B${{runner.workspace}}/build-sycl \ | |
| -DCMAKE_BUILD_TYPE:STRING=Release \ | |
| -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | |
| -DCMAKE_CXX_COMPILER:STRING=$(which icpx) \ | |
| -DCMAKE_C_COMPILER:STRING=$(which icx) \ | |
| -DCMAKE_CXX_FLAGS:STRING=-fsycl \ | |
| -DMARBLES_DIM:STRING=3 \ | |
| -DMARBLES_ENABLE_MPI:BOOL=OFF \ | |
| -DMARBLES_ENABLE_SYCL:BOOL=ON \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ | |
| ${{github.workspace}} | |
| - name: Build | |
| run: | | |
| set +e | |
| source /opt/intel/oneapi/setvars.sh | |
| set -e | |
| ccache -z | |
| cmake --build ${{runner.workspace}}/build-sycl --parallel ${{env.NPROCS}} | |
| - name: Ccache Report | |
| run: | | |
| ccache -s | |
| du -hs ${HOME}/.cache/ccache | |
| # Lint-cppcheck: | |
| # needs: Formatting | |
| # runs-on: macos-latest | |
| # strategy: | |
| # matrix: | |
| # dimension: [2D, 3D] | |
| # include: | |
| # - dimension: 2D | |
| # spacedim: 2 | |
| # - dimension: 3D | |
| # spacedim: 3 | |
| # steps: | |
| # - name: Clone | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # submodules: true | |
| # - name: Dependencies | |
| # run: brew install cppcheck | |
| # - name: Configure | |
| # run: | | |
| # cmake -B${{runner.workspace}}/build-cppcheck \ | |
| # -DMARBLES_DIM:STRING=${{matrix.spacedim}} \ | |
| # -DMARBLES_ENABLE_MPI:BOOL=OFF \ | |
| # -DMARBLES_TEST_WITH_FCOMPARE:BOOL=OFF \ | |
| # -DMARBLES_ENABLE_CPPCHECK:BOOL=ON \ | |
| # ${{github.workspace}} | |
| # - name: Check | |
| # working-directory: ${{runner.workspace}}/build-cppcheck | |
| # run: make cppcheck | |
| # - name: Full report | |
| # working-directory: ${{runner.workspace}}/build-cppcheck/cppcheck | |
| # run: cat cppcheck-full-report.txt | |
| # - name: Short report | |
| # working-directory: ${{runner.workspace}}/build-cppcheck/cppcheck | |
| # run: | | |
| # echo "::add-matcher::.github/problem-matchers/cppcheck.json" | |
| # awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' < cppcheck-report.txt > cppcheck-warnings.txt | |
| # cat cppcheck-warnings.txt | |
| # export return=$(tail -n 1 cppcheck-warnings.txt | awk '{print $2}') | |
| # exit ${return} | |
| Lint-clang-tidy: | |
| needs: Formatting | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| dimension: [2D, 3D] | |
| include: | |
| - dimension: 2D | |
| spacedim: 2 | |
| - dimension: 3D | |
| spacedim: 3 | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup | |
| run: | | |
| echo "NPROCS=$(nproc)" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESSLEVEL=5" >> $GITHUB_ENV | |
| echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV | |
| echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV | |
| - name: Install Ccache | |
| run: | | |
| wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | |
| tar xvf ccache-4.8-linux-x86_64.tar.xz | |
| sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ | |
| - name: Set Up Ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ccache | |
| key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.dimension}}-git-${{github.sha}} | |
| restore-keys: | | |
| ccache-${{github.workflow}}-${{github.job}}-${{matrix.dimension}}-git- | |
| - name: Configure | |
| run: | | |
| cmake -B${{runner.workspace}}/build-clang-tidy \ | |
| -DCMAKE_BUILD_TYPE:STRING=Debug \ | |
| -DCMAKE_CXX_COMPILER:STRING=clang++ \ | |
| -DCMAKE_C_COMPILER:STRING=clang \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ | |
| -DMARBLES_DIM:STRING=${{matrix.spacedim}} \ | |
| -DMARBLES_ENABLE_MPI:BOOL=OFF \ | |
| -DMARBLES_TEST_WITH_FCOMPARE:BOOL=OFF \ | |
| -DMARBLES_ENABLE_ALL_WARNINGS:BOOL=ON \ | |
| -DMARBLES_ENABLE_CLANG_TIDY:BOOL=ON \ | |
| ${{github.workspace}} | |
| - name: Check | |
| working-directory: ${{runner.workspace}}/build-clang-tidy | |
| run: | | |
| cmake --build . --parallel ${{env.NPROCS}} 2>&1 | tee -a clang-tidy-full-report.txt | |
| egrep "warning:|error:" clang-tidy-full-report.txt \ | |
| | egrep -v "Submodules/AMReX" \ | |
| | egrep -v "ld: warning:" | sort | uniq \ | |
| | awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > clang-tidy-warnings.txt | |
| - name: Ccache Report | |
| run: | | |
| ccache -s | |
| du -hs ${HOME}/.cache/ccache | |
| - name: Full report | |
| working-directory: ${{runner.workspace}}/build-clang-tidy | |
| run: cat clang-tidy-full-report.txt | |
| - name: Short report | |
| working-directory: ${{runner.workspace}}/build-clang-tidy | |
| run: | | |
| echo "::add-matcher::.github/problem-matchers/gcc.json" | |
| cat clang-tidy-warnings.txt | |
| export return=$(tail -n 1 clang-tidy-warnings.txt | awk '{print $2}') | |
| exit ${return} | |
| Lint-codeql: | |
| needs: Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup | |
| run: | | |
| echo "NPROCS=$(nproc)" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESSLEVEL=5" >> $GITHUB_ENV | |
| echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV | |
| echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV | |
| - name: Install Ccache | |
| run: | | |
| wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | |
| tar xvf ccache-4.8-linux-x86_64.tar.xz | |
| sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ | |
| - name: Set Up Ccache | |
| 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: Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: cpp | |
| queries: +security-and-quality | |
| config-file: ./.github/codeql/codeql-config.yml | |
| - name: Configure | |
| run: | | |
| cmake -B ${{runner.workspace}}/build-ci-codeql \ | |
| -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install-codeql \ | |
| -DCMAKE_BUILD_TYPE:STRING=Debug \ | |
| -DCMAKE_CXX_COMPILER:STRING=clang++ \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ | |
| -DCMAKE_C_COMPILER:STRING=clang \ | |
| -DMARBLES_ENABLE_MPI:BOOL=OFF \ | |
| -DMARBLES_TEST_WITH_FCOMPARE:BOOL=OFF \ | |
| ${{github.workspace}} | |
| - name: Build | |
| working-directory: ${{runner.workspace}}/build-ci-codeql | |
| run: | | |
| cmake --build . --parallel ${{env.NPROCS}} | |
| - name: Ccache Report | |
| run: | | |
| ccache -s | |
| du -hs ${HOME}/.cache/ccache | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| with: | |
| category: "/language:cpp" | |
| upload: False | |
| output: sarif-results | |
| - name: Filter CodeQL sarif | |
| uses: advanced-security/filter-sarif@v1 | |
| with: | |
| patterns: | | |
| -**/Submodules/** | |
| input: sarif-results/cpp.sarif | |
| output: sarif-results/cpp.sarif | |
| - name: Upload CodeQL sarif | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: sarif-results/cpp.sarif | |
| Lint-codespell: | |
| needs: Formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Dependencies | |
| run: | | |
| # Install Python packages | |
| python -m pip install --upgrade pip | |
| pip install codespell | |
| - name: Run codespell | |
| run: codespell | |
| 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 |