From 4c0a7a1d4a86143247b6ea7a5e4c7d6104d78590 Mon Sep 17 00:00:00 2001 From: greg7mdp Date: Fri, 20 Sep 2024 22:08:12 -0400 Subject: [PATCH] Update workflows Update `.github/workflows/linux.yml` Update `.github/workflows/linux.yml` Fix typo in `.github/workflows/linux.yml` Update workflows. Update windows workflow --- .github/workflows/linux.yml | 49 ++++++++++++++--------------------- .github/workflows/macos.yml | 43 ++++++++++++++---------------- .github/workflows/windows.yml | 44 +++++++++++++------------------ 3 files changed, 58 insertions(+), 78 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index dc8bf18..7979c6f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -10,37 +10,28 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04] - compiler: [g++-9, g++-10, clang++-17] - build_type: [Debug, Release] - standard: [20] + os: [ubuntu-latest] + compiler: [g++, clang++] + flags: [-std=c++20] + optimize: [-O2] + + env: + CXX: ${{ matrix.compiler }} + CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }} + CTEST_OUTPUT_ON_FAILURE: 1 + CTEST_NO_TESTS_ACTION: error + CTEST_PARALLEL_LEVEL: 0 + CMAKE_BUILD_PARALLEL_LEVEL: 4 + steps: - name: Checkout - uses: actions/checkout@v2.0.0 - - - name: Create Environment - run: | - sudo apt update - sudo apt install -y g++-9 g++-10 - wget https://apt.llvm.org/llvm.sh; chmod u+x llvm.sh; sudo ./llvm.sh 17 - cmake -E make_directory ${{runner.workspace}}/build + uses: actions/checkout@v4 - - name: Configure - working-directory: ${{runner.workspace}}/build - env: - CXX: ${{ matrix.compiler }} - run: | - cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} $GITHUB_WORKSPACE + - name: CMake configure + run: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release -B build - - name: Build - working-directory: ${{runner.workspace}}/build - run: | - cpus=`nproc` - cmake --build . --config ${{matrix.build_type}} --parallel $cpus + - name: CMake build + run: cmake --build build - - name: Test - working-directory: ${{runner.workspace}}/build - env: - CTEST_OUTPUT_ON_FAILURE: True - run: | - ctest -C ${{matrix.build_type}} + - name: CMake test + run: ctest --test-dir build diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index eda18bc..cf24051 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,31 +10,28 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-11, macos-latest] - build_type: [Debug, Release] - standard: [20] + os: [macos-latest] + compiler: [g++, clang++] + flags: [-std=c++20] + optimize: [-O2] + + env: + CXX: ${{ matrix.compiler }} + CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }} + CTEST_OUTPUT_ON_FAILURE: 1 + CTEST_NO_TESTS_ACTION: error + CTEST_PARALLEL_LEVEL: 0 + CMAKE_BUILD_PARALLEL_LEVEL: 4 + steps: - name: Checkout - uses: actions/checkout@v2.0.0 - - - name: Create Environment - run: | - cmake -E make_directory ${{runner.workspace}}/build + uses: actions/checkout@v4 - - name: Configure - working-directory: ${{runner.workspace}}/build - run: | - cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} $GITHUB_WORKSPACE + - name: CMake configure + run: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_BUILD_TYPE=Release -B build - - name: Build - working-directory: ${{runner.workspace}}/build - run: | - cpus=`sysctl -n hw.logicalcpu` - cmake --build . --config ${{matrix.build_type}} --parallel $cpus + - name: CMake build + run: cmake --build build - - name: Test - working-directory: ${{runner.workspace}}/build - env: - CTEST_OUTPUT_ON_FAILURE: True - run: | - ctest -C ${{matrix.build_type}} + - name: CMake test + run: ctest --test-dir build diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a2f6fb8..c0d86b4 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,34 +10,26 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-2019, windows-2022] - platform: [Win32, x64] - build_type: [Debug, Release] - standard: [20] + os: [windows-latest] + flags: ["/std:c++20", "/std:c++latest"] + optimize: [/O2] + + env: + CXXFLAGS: ${{ matrix.flags }} ${{ matrix.optimize }} + CTEST_OUTPUT_ON_FAILURE: 1 + CTEST_NO_TESTS_ACTION: error + CTEST_PARALLEL_LEVEL: 0 + CMAKE_BUILD_PARALLEL_LEVEL: 4 + steps: - name: Checkout - uses: actions/checkout@v2.0.0 - - - name: Create Environment - run: | - cmake -E make_directory ${{runner.workspace}}/build + uses: actions/checkout@v4 - - name: Configure - # bash shell for $GITHUB_WORKSPACE - shell: bash - working-directory: ${{runner.workspace}}/build - run: | - cmake -A ${{matrix.platform}} -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_CXX_STANDARD=${{matrix.standard}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} $GITHUB_WORKSPACE + - name: CMake configure + run: cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -B build - - name: Build - working-directory: ${{runner.workspace}}/build - run: | - $cpus = (Get-CimInstance Win32_ComputerSystem).NumberOfLogicalProcessors - cmake --build . --config ${{matrix.build_type}} --parallel $cpus + - name: CMake build + run: cmake --build build --config Release - - name: Test - working-directory: ${{runner.workspace}}/build - env: - CTEST_OUTPUT_ON_FAILURE: True - run: | - ctest -C ${{matrix.build_type}} + - name: CMake test + run: ctest --test-dir build -C Release