From 7ae17fbd996d7fd53ec046b77dcecabc74d5bdab Mon Sep 17 00:00:00 2001 From: doodspav Date: Mon, 30 Oct 2023 00:08:44 +0000 Subject: [PATCH] GHI #20 Make CI instructions more concise Signed-off-by: doodspav --- .github/workflows/test-base.yml | 62 +++++++++------------------------ CMakePresets.json | 9 ----- 2 files changed, 16 insertions(+), 55 deletions(-) diff --git a/.github/workflows/test-base.yml b/.github/workflows/test-base.yml index 5f6c4b189..a4126c80e 100644 --- a/.github/workflows/test-base.yml +++ b/.github/workflows/test-base.yml @@ -6,13 +6,26 @@ on: - "**" jobs: - test-native-windows-macos: + test-native: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, macos-latest] + os: [windows-latest, macos-latest, ubuntu-latest] build-type: [Debug, Release] build-shared: [OFF, ON] + include: + - os: windows-latest + preset: patomic-ci-windows-msvc + - os: macos-latest + preset: patomic-ci-unix-clang + - os: macos-latest + preset: patomic-ci-unix-gnu-ansi + - os: ubuntu-latest + preset: patomic-ci-unix-clang + - os: ubuntu-latest + preset: patomic-ci-unix-gcc + - os: ubuntu-latest + preset: patomic-ci-unix-gnu-ansi steps: - name: Checkout patomic @@ -41,50 +54,7 @@ jobs: cd patomic mkdir build cd build - cmake --preset patomic-ci-${{ matrix.os }} -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGTest_DIR=../../googletest/build/install/lib/cmake/GTest .. - cmake --build . --config ${{ matrix.build-type }} - - - name: Test patomic - run: | - cd patomic/build - ctest -C ${{ matrix.build-type }} . - - test-native-linux: - runs-on: ubuntu-latest - strategy: - matrix: - build-type: [Debug, Release] - build-shared: [OFF, ON] - compiler: [clang, gcc, gnu-ansi] - - steps: - - name: Checkout patomic - uses: actions/checkout@v4 - with: - path: patomic - - - name: Checkout GoogleTest - uses: actions/checkout@v4 - with: - repository: google/googletest - path: googletest - - - name: Build and Install GoogleTest - run: | - cd googletest - mkdir googletest - mkdir build - cd build - cmake -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} .. - cmake --build . --config ${{ matrix.build-type }} - cmake --install . --config ${{ matrix.build-type }} --prefix install - - - name: Build patomic - run: | - cd patomic - mkdir build - cd build - cmake --preset patomic-ci-unix-${{ matrix.compiler }} -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGTest_DIR=../../googletest/build/install/lib/cmake/GTest .. + cmake --preset ${{ matrix.preset }} -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGTest_DIR=../../googletest/build/install/lib/cmake/GTest .. cmake --build . --config ${{ matrix.build-type }} - name: Test patomic diff --git a/CMakePresets.json b/CMakePresets.json index e24ae81a0..3ee04fab8 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -157,15 +157,6 @@ "CMAKE_C_FLAGS": "-Wall -Wextra -Werror -Wpedantic -Wno-unused-function -Wno-atomic-alignment", "CMAKE_C_STANDARD": "90" } - }, - - { - "name": "patomic-ci-windows-latest", - "inherits": "patomic-ci-windows-msvc" - }, - { - "name": "patomic-ci-macos-latest", - "inherits": "patomic-ci-unix-clang" } ] }