tests were not running for non-msbuild

This commit is contained in:
Carson Radtke 2024-10-14 14:29:56 -05:00
parent 8b1634e806
commit d610d78829
2 changed files with 24 additions and 34 deletions

View File

@ -18,42 +18,39 @@ inputs:
required: false
type: string
default: ''
cmake_configure_only:
build_cmd:
required: true
type: string
default: 'make'
test_cmd:
required: false
type: boolean
default: 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: bash
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: bash
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 }}
- name: Build
if: ${{inputs.cmake_configure_only == false}}
working-directory: build
run: make
shell: bash
run: ${{ inputs.build_cmd }}
shell: ${{ inputs.shell }}
- name: Test
if: ${{inputs.cmake_configure_only == false}}
working-directory: build
run: make test
shell: bash
run: ${{ inputs.test_cmd }}
shell: ${{ inputs.shell }}

View File

@ -89,23 +89,16 @@ jobs:
runs-on: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Run CMake (configure only)
- name: Run CMake (configure, build, test)
uses: ./.github/workflows/cmake
with:
cmake_generator: ${{ matrix.generator }}
cmake_build_type: ${{ matrix.build_type }}
cmake_configure_only: true
gsl_cxx_standard: ${{ matrix.cxx_version }}
extra_cmake_args: ${{ matrix.extra_args }}
- uses: microsoft/setup-msbuild@v2
- name: build
working-directory: build
run: msbuild GSL.sln
- name: test
working-directory: build
run: ctest . --output-on-failure --no-compress-output
build_cmd: msbuild GSL.sln
test_cmd: ctest . --output-on-failure --no-compress-output
shell: pwsh