diff --git a/.github/workflows/cmake/action.yml b/.github/workflows/cmake/action.yml index 122feb8..0ac09bf 100644 --- a/.github/workflows/cmake/action.yml +++ b/.github/workflows/cmake/action.yml @@ -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 }} diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 2173887..23866a6 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -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