From 0321b5f0a708880af11e99b66e2329bbcfbb0648 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 11 Jan 2023 13:22:25 +0700 Subject: [PATCH] replace language matrix in `use-action-with-specified-compiler` job with os matrix --- .github/workflows/test.yml | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d4a4e33..9b66abe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,38 +40,28 @@ jobs: run: test ! -d build use-action-with-specified-compiler: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: - lang: [C, CXX] + os: [windows-latest, ubuntu-latest, macos-latest] steps: - name: Checkout repository uses: actions/checkout@v3.3.0 - - name: Use this action with specified invalid compiler - id: failed_step - continue-on-error: true - uses: ./ - with: - source-dir: test - c-compiler: ${{ matrix.lang == 'C' && 'invalid' || '' }} - cxx-compiler: ${{ matrix.lang == 'CXX' && 'invalid' || '' }} - - - name: Check if previous step is failing - run: ${{ steps.failed_step.outcome == 'failure' && 'true' || 'false' }} - - name: Use this action with specified compiler uses: ./ with: source-dir: test - c-compiler: ${{ matrix.lang == 'C' && 'clang' || '' }} - cxx-compiler: ${{ matrix.lang == 'CXX' && 'clang++' || '' }} + c-compiler: clang + cxx-compiler: clang++ args: | - -D BUILD_C=${{ matrix.lang == 'C' && 'ON' || 'OFF' }} - -D BUILD_CXX=${{ matrix.lang == 'CXX' && 'ON' || 'OFF' }} + -D BUILD_C=ON + -D BUILD_CXX=ON - name: Run build result - run: build/${{ matrix.lang == 'C' && 'hello_world_c' || 'hello_world' }} + run: | + {{ matrix.os == 'windows-latest' && 'build\Debug\hello_world.exe' || 'build/hello_world' }} + {{ matrix.os == 'windows-latest' && 'build\Debug\hello_world_c.exe' || 'build/hello_world_c' }} use-action-with-specified-generator: runs-on: ${{ matrix.os }}