feat: add build-dir action output

This commit is contained in:
Alfi Maulana
2023-07-02 19:21:30 +07:00
parent 555658bd6a
commit 0a60e2eb74
2 changed files with 21 additions and 13 deletions

View File

@@ -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