-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor cmake behavior to resuable action
- Loading branch information
1 parent
e25059a
commit 041f03f
Showing
2 changed files
with
104 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Composite CMake | ||
inputs: | ||
cmake_generator: | ||
required: false | ||
type: string | ||
default: 'Unix Makefiles' | ||
cmake_build_type: | ||
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: '' | ||
cmake_configure_only: | ||
required: false | ||
type: boolean | ||
default: false | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Create build directory | ||
run: mkdir build | ||
shell: bash | ||
|
||
- 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 | ||
|
||
- name: Build | ||
if: "!${{ inputs.cmake_configure_only }}" | ||
working-directory: build | ||
run: make | ||
shell: bash | ||
|
||
- name: Test | ||
if: "!${{ inputs.cmake_configure_only }}" | ||
working-directory: build | ||
run: make test | ||
shell: bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters