Merge pull request #15 from threeal/auto-install-ninja

Auto Install Ninja
This commit is contained in:
Alfi Maulana 2023-01-10 18:41:52 +07:00 committed by GitHub
commit f6a81b48ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -74,14 +74,14 @@ jobs:
run: build/${{ matrix.lang == 'C' && 'hello_world_c' || 'hello_world' }} run: build/${{ matrix.lang == 'C' && 'hello_world_c' || 'hello_world' }}
use-action-with-specified-generator: use-action-with-specified-generator:
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3.3.0 uses: actions/checkout@v3.3.0
- name: Install Ninja
run: sudo apt install -y ninja-build
- name: Use this action with specified generator - name: Use this action with specified generator
uses: ./ uses: ./
with: with:

View File

@ -48,6 +48,16 @@ runs:
echo "CMAKE_CONFIGURE_ARGS=${CONFIGURE_ARGS//[$'\t\r\n']}" >> $GITHUB_ENV echo "CMAKE_CONFIGURE_ARGS=${CONFIGURE_ARGS//[$'\t\r\n']}" >> $GITHUB_ENV
echo "CMAKE_BUILD_ARGS=${BUILD_ARGS//[$'\t\r\n']}" >> $GITHUB_ENV echo "CMAKE_BUILD_ARGS=${BUILD_ARGS//[$'\t\r\n']}" >> $GITHUB_ENV
- name: Install Ninja
if: ${{ inputs.generator == 'Ninja' }}
shell: bash
run: |
case "$OSTYPE" in
darwin*) brew install ninja ;;
linux*) sudo apt install -y ninja-build ;;
*) choco install ninja ;;
esac
- name: Configure CMake - name: Configure CMake
shell: bash shell: bash
run: cmake ${{ env.CMAKE_CONFIGURE_ARGS }} run: cmake ${{ env.CMAKE_CONFIGURE_ARGS }}