add build-dir input

This commit is contained in:
Alfi Maulana 2023-01-07 11:39:03 +07:00
parent 9a1f68f162
commit a0fbcc2eb0
No known key found for this signature in database
GPG Key ID: 2242A64C2A8DF5A4

View File

@ -9,14 +9,20 @@ inputs:
description: The source directory of CMake project description: The source directory of CMake project
required: false required: false
default: . default: .
build-dir:
description: The build directory of CMake project
required: false
default: build
runs: runs:
using: composite using: composite
steps: steps:
- name: Process inputs - name: Process inputs
shell: bash shell: bash
run: | run: |
CONFIGURE_ARGS="'${{ inputs.source-dir }}' -B build" CONFIGURE_ARGS="'${{ inputs.source-dir }}' -B '${{ inputs.build-dir }}'"
BUILD_ARGS="--build '${{ inputs.build-dir }}'"
echo "CMAKE_CONFIGURE_ARGS=$CONFIGURE_ARGS" >> $GITHUB_ENV echo "CMAKE_CONFIGURE_ARGS=$CONFIGURE_ARGS" >> $GITHUB_ENV
echo "CMAKE_BUILD_ARGS=$BUILD_ARGS" >> $GITHUB_ENV
- name: Configure CMake - name: Configure CMake
shell: bash shell: bash
@ -24,4 +30,4 @@ runs:
- name: Build targets - name: Build targets
shell: bash shell: bash
run: cmake --build build run: cmake ${{ env.CMAKE_BUILD_ARGS }}