diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f789a00..d4a4e33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -74,14 +74,14 @@ jobs: run: build/${{ matrix.lang == 'C' && 'hello_world_c' || 'hello_world' }} use-action-with-specified-generator: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] steps: - name: Checkout repository uses: actions/checkout@v3.3.0 - - name: Install Ninja - run: sudo apt install -y ninja-build - - name: Use this action with specified generator uses: ./ with: diff --git a/action.yml b/action.yml index ccb28c8..8c80fd3 100644 --- a/action.yml +++ b/action.yml @@ -48,6 +48,16 @@ runs: echo "CMAKE_CONFIGURE_ARGS=${CONFIGURE_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 shell: bash run: cmake ${{ env.CMAKE_CONFIGURE_ARGS }}