Merge pull request #4 from threeal/add-source-dir-input

Add `Source-Dir` Input Option
This commit is contained in:
Alfi Maulana 2023-01-06 21:37:53 +07:00 committed by GitHub
commit 9a1f68f162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 1 deletions

View File

@ -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

View File

@ -1,3 +1,5 @@
# CMake Action
[![test status](https://img.shields.io/github/actions/workflow/status/threeal/cmake-action/test.yml?label=test&branch=main)](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).

View File

@ -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