Skip to content

Commit

Permalink
use an action for cmake instead of doing things manually
Browse files Browse the repository at this point in the history
  • Loading branch information
dmah42 committed Jan 30, 2025
1 parent 8a3c0ec commit 33acda9
Showing 1 changed file with 30 additions and 52 deletions.
82 changes: 30 additions & 52 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: lukka/get-cmake@latest

- name: create build environment
run: cmake -E make_directory ${{ runner.workspace }}/_build

- name: setup cmake initial cache
run: touch compiler-cache.cmake

- name: configure cmake
env:
CXX: ${{ matrix.compiler }}
shell: bash
working-directory: ${{ runner.workspace }}/_build
run: >
cmake -C ${{ github.workspace }}/compiler-cache.cmake
$GITHUB_WORKSPACE
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
-DBUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_CXX_COMPILER=${{ env.CXX }}
-DCMAKE_CXX_VISIBILITY_PRESET=hidden
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON
- name: build
shell: bash
working-directory: ${{ runner.workspace }}/_build
run: cmake --build . --config ${{ matrix.build_type }}
uses: threeal/[email protected]
with:
build-dir: ${{ runner.workspace }}/_build
cxx-compiler: ${{ matrix.compiler }}
options: |
BENCHMARK_DOWNLOAD_DEPENDENCIES=ON
BUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
CMAKE_BUILD_TYPE=${{ matrix.build_type }}
CMAKE_CXX_COMPILER=${{ env.CXX }}
CMAKE_CXX_VISIBILITY_PRESET=hidden
CMAKE_VISIBILITY_INLINES_HIDDEN=ON
- name: test
shell: bash
Expand All @@ -70,8 +55,6 @@ jobs:
msvc:
- VS-16-2019
- VS-17-2022
arch:
- x64
build_type:
- Debug
- Release
Expand All @@ -89,21 +72,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: lukka/get-cmake@latest

- name: configure cmake
run: >
cmake -S . -B _build/
-A ${{ matrix.arch }}
-G "${{ matrix.generator }}"
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
-DBUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
- name: build
run: cmake --build _build/ --config ${{ matrix.build_type }}
uses: threeal/[email protected]
with:
build-dir: ${{ runner.workspace }}/_build
generator: ${{ matrix.generator }}
options: |
BENCHMARK_DOWNLOAD_DEPENDENCIES=ON
BUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
- name: test
run: ctest --test-dir _build/ -C ${{ matrix.build_type }} -VV
working-directory: ${{ runner.workspace }}/_build
run: ctest -C ${{ matrix.build_type }} -VV

msys2:
name: ${{ matrix.os }}.${{ matrix.build_type }}.${{ matrix.lib }}.${{ matrix.msys2.msystem }}
Expand Down Expand Up @@ -143,20 +123,18 @@ jobs:
pacboy: >-
gcc:p
clang:p
cmake:p
ninja:p
- name: configure cmake
env:
CXX: ${{ matrix.msys2.compiler }}
run: >
cmake -S . -B _build/
-GNinja
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
-DBUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
- name: build
run: cmake --build _build/ --config ${{ matrix.build_type }}
uses: threeal/[email protected]
with:
build-dir: ${{ runner.workspace }}/_build
generator: Ninja
cxx-compiler: ${{ matrix.msys2.msystem.compiler }}
options: |
BENCHMARK_DOWNLOAD_DEPENDENCIES=ON
BUILD_SHARED_LIBS=${{ matrix.lib == 'shared' }}
- name: test
run: ctest --test-dir _build/ -C ${{ matrix.build_type }} -VV
working-directory: ${{ runner.workspace }}/_build
run: ctest -C ${{ matrix.build_type }} -VV

0 comments on commit 33acda9

Please sign in to comment.