mirror of
https://github.com/threeal/cmake-action.git
synced 2025-06-09 10:41:22 +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
|
- name: Run build result
|
||||||
run: ./build/hello_world
|
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
|
# 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).
|
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:
|
branding:
|
||||||
color: gray-dark
|
color: gray-dark
|
||||||
icon: terminal
|
icon: terminal
|
||||||
|
inputs:
|
||||||
|
source-dir:
|
||||||
|
description: The source directory of CMake project
|
||||||
|
required: false
|
||||||
|
default: .
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
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
|
- name: Configure CMake
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cmake . -B build
|
run: cmake ${{ env.CMAKE_CONFIGURE_ARGS }}
|
||||||
|
|
||||||
- name: Build targets
|
- name: Build targets
|
||||||
shell: bash
|
shell: bash
|
||||||
|
Loading…
Reference in New Issue
Block a user