mirror of
https://github.com/threeal/cmake-action.git
synced 2025-04-21 19:11:21 +00:00
Merge pull request #4 from threeal/add-source-dir-input
Add `Source-Dir` Input Option
This commit is contained in:
commit
9a1f68f162
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -17,3 +17,17 @@ jobs:
|
||||
|
||||
- name: Run build result
|
||||
run: ./build/hello_world
|
||||
|
||||
use-action-with-specified-source-dir:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3.3.0
|
||||
|
||||
- name: Use this action with specified source directory
|
||||
uses: ./
|
||||
with:
|
||||
source-dir: test
|
||||
|
||||
- name: Run build result
|
||||
run: ./build/hello_world
|
||||
|
@ -1,3 +1,5 @@
|
||||
# CMake Action
|
||||
|
||||
[](https://github.com/threeal/cmake-action/actions/workflows/test.yml)
|
||||
|
||||
Configure and build [CMake](https://cmake.org/) project on [GitHub Actions](https://github.com/features/actions).
|
||||
|
13
action.yml
13
action.yml
@ -4,12 +4,23 @@ author: Alfi Maulana
|
||||
branding:
|
||||
color: gray-dark
|
||||
icon: terminal
|
||||
inputs:
|
||||
source-dir:
|
||||
description: The source directory of CMake project
|
||||
required: false
|
||||
default: .
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Process inputs
|
||||
shell: bash
|
||||
run: |
|
||||
CONFIGURE_ARGS="'${{ inputs.source-dir }}' -B build"
|
||||
echo "CMAKE_CONFIGURE_ARGS=$CONFIGURE_ARGS" >> $GITHUB_ENV
|
||||
|
||||
- name: Configure CMake
|
||||
shell: bash
|
||||
run: cmake . -B build
|
||||
run: cmake ${{ env.CMAKE_CONFIGURE_ARGS }}
|
||||
|
||||
- name: Build targets
|
||||
shell: bash
|
||||
|
Loading…
Reference in New Issue
Block a user