From 88531efb6821d60553a17013760c2de3c4556868 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Mon, 7 Oct 2024 14:38:57 -0600 Subject: [PATCH] :arrow_up: :construction_worker: Update workflows to ubuntu-24.04 --- .github/workflows/asciidoctor-ghpages.yml | 11 +- .github/workflows/unit_tests.yml | 142 +++++++++++++++------- test/CMakeLists.txt | 1 - 3 files changed, 103 insertions(+), 51 deletions(-) diff --git a/.github/workflows/asciidoctor-ghpages.yml b/.github/workflows/asciidoctor-ghpages.yml index 6a4c702..a252e20 100644 --- a/.github/workflows/asciidoctor-ghpages.yml +++ b/.github/workflows/asciidoctor-ghpages.yml @@ -12,7 +12,7 @@ env: jobs: configure: name: Configure Github Pages Publishing - runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 + runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 outputs: enable_publish: ${{ steps.check.outputs.isfork == 'NO' }} steps: @@ -30,18 +30,17 @@ jobs: build: needs: configure name: Build Documentation - runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 + runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - name: Checkout source uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Setup Node.js uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: - node-version: 18 + node-version: 20 - name: Install Mermaid run: | - sudo npm install -g @mermaid-js/mermaid-cli@10.6.1 - node /usr/local/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer/install.js + sudo npm install -g @mermaid-js/mermaid-cli@11.2.0 - name: Install asciidoctor run: | sudo apt update @@ -73,7 +72,7 @@ jobs: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 + runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - name: Deploy to github pages id: deployment diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index b66d5aa..5c70447 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -21,13 +21,13 @@ concurrency: cancel-in-progress: true jobs: - build_and_test: - runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 + build_and_test_24: + runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 strategy: fail-fast: false matrix: compiler: [clang, gcc] - version: [12, 13, 14, 15, 16, 17, 18] + version: [12, 13, 16, 17, 18] cxx_standard: [20] stdlib: [libstdc++, libc++] build_type: [Debug] @@ -47,51 +47,33 @@ jobs: cxx_flags: "-stdlib=libc++" - version: 17 compiler: clang - install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 17 + install: sudo apt update && sudo apt install -y clang-17 toolchain_root: "/usr/lib/llvm-17" - version: 17 compiler: clang stdlib: libc++ - install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 17 && sudo apt install -y libc++-17-dev libc++abi-17-dev + install: sudo apt update && sudo apt install -y clang-17 libc++-17-dev libc++abi-17-dev cxx_flags: "-stdlib=libc++" - version: 16 compiler: clang - install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16 + install: sudo apt update && sudo apt install -y clang-16 toolchain_root: "/usr/lib/llvm-16" - version: 16 compiler: clang stdlib: libc++ - install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16 && sudo apt install -y libc++-16-dev libc++abi-16-dev - cxx_flags: "-stdlib=libc++" - - version: 15 - compiler: clang - install: sudo apt update && sudo apt install -y clang-15 - toolchain_root: "/usr/lib/llvm-15" - - version: 15 - compiler: clang - stdlib: libc++ - install: sudo apt update && sudo apt install -y clang-15 libc++-15-dev libc++abi-15-dev - cxx_flags: "-stdlib=libc++" - - version: 14 - compiler: clang - install: sudo apt update && sudo apt install -y clang-14 - toolchain_root: "/usr/lib/llvm-14" - - version: 14 - compiler: clang - stdlib: libc++ - install: sudo apt update && sudo apt install -y clang-14 libc++-14-dev libc++abi-14-dev + install: sudo apt update && sudo apt install -y clang-16 libc++-16-dev libc++abi-16-dev cxx_flags: "-stdlib=libc++" - compiler: gcc toolchain_root: "/usr" cxx_flags: "" - version: 13 compiler: gcc - install: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt-get install -y gcc-13 g++-13 + install: sudo apt update && sudo apt install -y gcc-13 g++-13 cc: "gcc-13" cxx: "g++-13" - version: 12 compiler: gcc - install: sudo apt update && sudo apt install -y gcc-12 + install: sudo apt update && sudo apt install -y gcc-12 g++-12 cc: "gcc-12" cxx: "g++-12" cxx_flags: "" @@ -102,13 +84,6 @@ jobs: version: 17 - compiler: gcc version: 16 - - compiler: gcc - version: 15 - - compiler: gcc - version: 14 - - compiler: clang - version: 14 - stdlib: libstdc++ - compiler: clang version: 13 - compiler: clang @@ -157,8 +132,87 @@ jobs: working-directory: ${{github.workspace}}/build run: ctest --output-on-failure -j $(nproc) -C ${{matrix.build_type}} - quality_checks_pass: + build_and_test_22: runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 + strategy: + fail-fast: false + matrix: + compiler: [clang] + version: [14, 15] + cxx_standard: [20] + stdlib: [libstdc++, libc++] + build_type: [Debug] + include: + - compiler: clang + cc: "clang" + cxx: "clang++" + cxx_flags: "-stdlib=libstdc++" + - version: 15 + compiler: clang + install: sudo apt update && sudo apt install -y clang-15 + toolchain_root: "/usr/lib/llvm-15" + - version: 15 + compiler: clang + stdlib: libc++ + install: sudo apt update && sudo apt install -y clang-15 libc++-15-dev libc++abi-15-dev + cxx_flags: "-stdlib=libc++" + - version: 14 + compiler: clang + install: sudo apt update && sudo apt install -y clang-14 + toolchain_root: "/usr/lib/llvm-14" + - version: 14 + compiler: clang + stdlib: libc++ + install: sudo apt update && sudo apt install -y clang-14 libc++-14-dev libc++abi-14-dev + cxx_flags: "-stdlib=libc++" + exclude: + - compiler: clang + version: 14 + stdlib: libstdc++ + + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + + - name: Install build tools + run: | + ${{ matrix.install }} + sudo apt install -y ninja-build + + - name: Restore CPM cache + env: + cache-name: cpm-cache-0 + id: cpm-cache-restore + uses: actions/cache/restore@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0 + with: + path: ~/cpm-cache + key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }} + restore-keys: | + ${{runner.os}}-${{env.cache-name}}- + + - name: Configure CMake + env: + CC: ${{matrix.toolchain_root}}/bin/${{matrix.cc}} + CXX: ${{matrix.toolchain_root}}/bin/${{matrix.cxx}} + run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} -DCMAKE_CXX_FLAGS_INIT=${{matrix.cxx_flags}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCPM_SOURCE_CACHE=~/cpm-cache + + - name: Save CPM cache + env: + cache-name: cpm-cache-0 + if: steps.cpm-cache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0 + with: + path: ~/cpm-cache + key: ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }} + + - name: Build Unit Tests + run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -v -t build_unit_tests + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest --output-on-failure -j $(nproc) -C ${{matrix.build_type}} + + quality_checks_pass: + runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - name: Checkout target branch uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 @@ -175,12 +229,13 @@ jobs: - name: Install build tools run: | wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh ${{env.DEFAULT_LLVM_VERSION}} - sudo apt install -y python3-pip ninja-build clang-tidy-${{env.DEFAULT_LLVM_VERSION}} clang-format-${{env.DEFAULT_LLVM_VERSION}} + sudo apt install -y pipx ninja-build clang-tidy-${{env.DEFAULT_LLVM_VERSION}} clang-format-${{env.DEFAULT_LLVM_VERSION}} - name: Install cmake-format run: | - sudo pip3 install --upgrade pip - sudo pip3 install pyyaml cmake-format + pipx install cmakelang + pipx inject cmakelang pyyaml + echo "/opt/pipx_bin" >> $GITHUB_PATH - name: Restore CPM cache env: @@ -213,7 +268,7 @@ jobs: run: cmake --build ${{github.workspace}}/build -t ci-quality sanitize: - runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 + runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 strategy: fail-fast: false matrix: @@ -228,7 +283,7 @@ jobs: - compiler: gcc cc: "gcc-13" cxx: "g++-13" - install: sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-13 g++-13 + install: sudo apt update && sudo apt install -y gcc-13 g++-13 toolchain_root: "/usr" steps: @@ -277,13 +332,12 @@ jobs: run: cmake --build ${{github.workspace}}/build -t unit_tests valgrind: - runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 + runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Install build tools run: | - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt update && sudo apt install -y gcc-${{env.DEFAULT_GCC_VERSION}} g++-${{env.DEFAULT_GCC_VERSION}} ninja-build valgrind - name: Restore CPM cache @@ -349,8 +403,8 @@ jobs: test $FAILSIZE = "0" merge_ok: - runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04 - needs: [build_and_test, quality_checks_pass, sanitize, valgrind] + runs-on: ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-24.04 + needs: [build_and_test_24, build_and_test_22, quality_checks_pass, sanitize, valgrind] if: ${{ !cancelled() }} steps: - name: Enable merge diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d545852..9f89407 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,7 +14,6 @@ function(add_tests) async fmt::fmt-header-only pthread) - target_compile_features("${name}_test" PRIVATE cxx_std_23) endforeach() endfunction()