Skip to content

Commit

Permalink
GHI #20 Make CI instructions more concise
Browse files Browse the repository at this point in the history
Signed-off-by: doodspav <[email protected]>
  • Loading branch information
doodspav committed Oct 30, 2023
1 parent b24c8c8 commit 7ae17fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 55 deletions.
62 changes: 16 additions & 46 deletions .github/workflows/test-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}

0 comments on commit 7ae17fb

Please sign in to comment.