mirror of
https://github.com/threeal/cmake-action.git
synced 2025-04-22 11:31:21 +00:00
replace language matrix in use-action-with-specified-compiler
job with os matrix
This commit is contained in:
parent
4ba6e49b5d
commit
0321b5f0a7
28
.github/workflows/test.yml
vendored
28
.github/workflows/test.yml
vendored
@ -40,38 +40,28 @@ jobs:
|
|||||||
run: test ! -d build
|
run: test ! -d build
|
||||||
|
|
||||||
use-action-with-specified-compiler:
|
use-action-with-specified-compiler:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
lang: [C, CXX]
|
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: 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
|
- name: Use this action with specified compiler
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
source-dir: test
|
source-dir: test
|
||||||
c-compiler: ${{ matrix.lang == 'C' && 'clang' || '' }}
|
c-compiler: clang
|
||||||
cxx-compiler: ${{ matrix.lang == 'CXX' && 'clang++' || '' }}
|
cxx-compiler: clang++
|
||||||
args: |
|
args: |
|
||||||
-D BUILD_C=${{ matrix.lang == 'C' && 'ON' || 'OFF' }}
|
-D BUILD_C=ON
|
||||||
-D BUILD_CXX=${{ matrix.lang == 'CXX' && 'ON' || 'OFF' }}
|
-D BUILD_CXX=ON
|
||||||
|
|
||||||
- name: Run build result
|
- 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:
|
use-action-with-specified-generator:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
Loading…
Reference in New Issue
Block a user