Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 9 additions & 40 deletions .github/workflows/cmake/action.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,25 @@
name: Composite CMake
inputs:
cmake_generator:
required: false
type: string
default: 'Unix Makefiles'
cmake_build_type:
cmake_preset:
required: true
type: string
default: ''
cmake_cxx_compiler:
required: false
type: string
gsl_cxx_standard:
required: true
type: number
extra_cmake_args:
required: false
type: string
default: ''
build_cmd:
required: true
type: string
default: 'make'
test_cmd:
required: false
type: string
default: 'make test'
shell:
required: false
type: string
default: 'bash'


runs:
using: composite
steps:
- name: Create build directory
run: mkdir build
shell: ${{ inputs.shell }}

- name: Configure CMake
working-directory: build
run: cmake -G "${{ inputs.cmake_generator }}" -DCMAKE_BUILD_TYPE=${{ inputs.cmake_build_type }} -DCMAKE_CXX_COMPILER=${{ inputs.cmake_cxx_compiler }} -DGSL_CXX_STANDARD=${{ inputs.gsl_cxx_standard }} -DCI_TESTING:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -Werror=dev ${{ inputs.extra_cmake_args }} ..
shell: ${{ inputs.shell }}
run: cmake --preset ${{ inputs.cmake_preset }} -DCI_TESTING:BOOL=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -Werror=dev ${{ inputs.extra_cmake_args }}
shell: bash

- name: Build
working-directory: build
run: ${{ inputs.build_cmd }}
shell: ${{ inputs.shell }}
- name: Build (with preset)
run: cmake --build --preset ${{ inputs.cmake_preset }}
shell: bash

- name: Test
working-directory: build
run: ${{ inputs.test_cmd }}
shell: ${{ inputs.shell }}
- name: Test (with preset)
run: ctest --preset ${{ inputs.cmake_preset }} --output-on-failure --no-compress-output
shell: pwsh

18 changes: 4 additions & 14 deletions .github/workflows/compilers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ jobs:
- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_build_type: ${{ matrix.build_type }}
cmake_cxx_compiler: g++-${{ matrix.gcc_version }}
gsl_cxx_standard: ${{ matrix.cxx_version }}
cmake_preset: gcc-${{ matrix.cxx_version }}-${{ matrix.build_type == 'Debug' && 'debug' || 'release' }}

clang:
strategy:
Expand All @@ -58,9 +56,7 @@ jobs:
- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_build_type: ${{ matrix.build_type }}
cmake_cxx_compiler: clang++-${{ matrix.clang_version }}
gsl_cxx_standard: ${{ matrix.cxx_version }}
cmake_preset: clang-${{ matrix.cxx_version }}-${{ matrix.build_type == 'Debug' && 'debug' || 'release' }}

xcode:
strategy:
Expand All @@ -78,9 +74,7 @@ jobs:
- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_build_type: ${{ matrix.build_type }}
cmake_cxx_compiler: clang++
gsl_cxx_standard: ${{ matrix.cxx_version }}
cmake_preset: clang-${{ matrix.cxx_version }}-${{ matrix.build_type == 'Debug' && 'debug' || 'release' }}
extra_cmake_args: '-DCMAKE_CXX_FLAGS="-isysroot \"$(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk\""'

VisualStudio:
Expand All @@ -99,11 +93,7 @@ jobs:
- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_generator: ${{ matrix.generator }}
cmake_build_type: ${{ matrix.build_type }}
gsl_cxx_standard: ${{ matrix.cxx_version }}
cmake_preset: msvc-${{ matrix.cxx_version }}-${{ matrix.build_type == 'Debug' && 'debug' || 'release' }}
extra_cmake_args: ${{ matrix.extra_args }}
build_cmd: msbuild GSL.sln
test_cmd: ctest . --output-on-failure --no-compress-output
shell: pwsh

4 changes: 2 additions & 2 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y clang cmake make

- name: Configure CMake (C++14)
run: cmake -B build-cxx14 . -DGSL_CXX_STANDARD=14 -DGSL_TEST=ON -G "Unix Makefiles"
run: cmake --preset clang-14-debug

- name: Configure CMake (C++20)
run: cmake -B build-cxx20 . -DGSL_CXX_STANDARD=20 -DGSL_TEST=ON -G "Unix Makefiles"
run: cmake --preset clang-20-debug

Loading
Loading