mirror of
https://github.com/threeal/cmake-action.git
synced 2026-02-01 19:40:49 +00:00
feat: add build-dir action output
This commit is contained in:
15
.github/workflows/test.yml
vendored
15
.github/workflows/test.yml
vendored
@@ -19,12 +19,13 @@ jobs:
|
||||
run: mv test/* .
|
||||
|
||||
- name: Use the action
|
||||
id: cmake-action
|
||||
uses: ./
|
||||
|
||||
- name: Try to test the project
|
||||
id: failed-step
|
||||
continue-on-error: true
|
||||
run: ctest --test-dir build --output-on-failure --no-tests=error -R hello_world ${{ matrix.os == 'windows' && '-C Debug' || '' }}
|
||||
run: ctest --test-dir ${{ steps.cmake-action.outputs.build-dir }} --output-on-failure --no-tests=error -R hello_world ${{ matrix.os == 'windows' && '-C Debug' || '' }}
|
||||
|
||||
- name: Check on success
|
||||
if: steps.failed-step.outcome == 'success'
|
||||
@@ -32,8 +33,8 @@ jobs:
|
||||
|
||||
- name: Build and test the project
|
||||
run: |
|
||||
cmake --build build
|
||||
ctest --test-dir build --output-on-failure --no-tests=error -R hello_world ${{ matrix.os == 'windows' && '-C Debug' || '' }}
|
||||
cmake --build ${{ steps.cmake-action.outputs.build-dir }}
|
||||
ctest --test-dir ${{ steps.cmake-action.outputs.build-dir }} --output-on-failure --no-tests=error -R hello_world ${{ matrix.os == 'windows' && '-C Debug' || '' }}
|
||||
|
||||
specified-dir-usage:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -42,6 +43,7 @@ jobs:
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Use the action with specified directories
|
||||
id: cmake-action
|
||||
uses: ./
|
||||
with:
|
||||
source-dir: test
|
||||
@@ -53,8 +55,8 @@ jobs:
|
||||
|
||||
- name: Build and test the project
|
||||
run: |
|
||||
cmake --build output
|
||||
ctest --test-dir output --output-on-failure --no-tests=error -R hello_world
|
||||
cmake --build ${{ steps.cmake-action.outputs.build-dir }}
|
||||
ctest --test-dir ${{ steps.cmake-action.outputs.build-dir }} --output-on-failure --no-tests=error -R hello_world
|
||||
|
||||
run-build-usage:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -63,6 +65,7 @@ jobs:
|
||||
uses: actions/checkout@v3.5.3
|
||||
|
||||
- name: Use the action with run build enabled
|
||||
id: cmake-action
|
||||
uses: ./
|
||||
with:
|
||||
source-dir: test
|
||||
@@ -70,7 +73,7 @@ jobs:
|
||||
build-args: --target test_c --target test_cpp
|
||||
|
||||
- name: Test the project
|
||||
run: ctest --test-dir test/build --output-on-failure --no-tests=error -R test
|
||||
run: ctest --test-dir ${{ steps.cmake-action.outputs.build-dir }} --output-on-failure --no-tests=error -R test
|
||||
|
||||
run-test-usage:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user