mirror of
https://github.com/threeal/cmake-action.git
synced 2025-06-09 18:51:21 +00:00
ci: expand jobs to test for run-build
and run-test
inputs
This commit is contained in:
parent
f1910e1a56
commit
62ad24196f
66
.github/workflows/test.yml
vendored
66
.github/workflows/test.yml
vendored
@ -11,37 +11,77 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [windows, ubuntu, macos]
|
os: [windows, ubuntu, macos]
|
||||||
steps:
|
steps:
|
||||||
- name: Check out this repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v3.5.3
|
uses: actions/checkout@v3.5.3
|
||||||
|
|
||||||
- name: Move test project to the working directory
|
- name: Move the test project to the working directory
|
||||||
run: mv test/* .
|
run: mv test/* .
|
||||||
|
|
||||||
- name: Use this action
|
- name: Use the action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
|
||||||
run-build: true
|
|
||||||
|
|
||||||
- name: Run the build result
|
- name: Try to test the project
|
||||||
run: ${{ matrix.os == 'windows' && 'build\Debug\hello_world.exe' || 'build/hello_world' }}
|
id: failed-step
|
||||||
|
continue-on-error: true
|
||||||
|
run: ctest --test-dir build --output-on-failure --no-tests=error
|
||||||
|
|
||||||
|
- name: Check on success
|
||||||
|
if: steps.failed-step.outcome == 'success'
|
||||||
|
run: exit 1
|
||||||
|
|
||||||
|
- name: Build and test the project
|
||||||
|
run: |
|
||||||
|
cmake --build build
|
||||||
|
ctest --test-dir build --output-on-failure --no-tests=error
|
||||||
|
|
||||||
specified-dir-usage:
|
specified-dir-usage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out this repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v3.5.3
|
uses: actions/checkout@v3.5.3
|
||||||
|
|
||||||
- name: Use this action with specified directories
|
- name: Use the action with specified directories
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
source-dir: test
|
source-dir: test
|
||||||
build-dir: output
|
build-dir: output
|
||||||
run-build: true
|
|
||||||
run-test: true
|
|
||||||
test-args: -R hello_world
|
|
||||||
|
|
||||||
- name: Check if the default build directory does not exist
|
- name: Check if the default build directory does not exist
|
||||||
run: test ! -d build && test ! -d test/build
|
shell: bash
|
||||||
|
run: test ! -e build && test ! -e test/build
|
||||||
|
|
||||||
|
- name: Build and test the project
|
||||||
|
run: |
|
||||||
|
cmake --build output
|
||||||
|
ctest --test-dir output --output-on-failure --no-tests=error
|
||||||
|
|
||||||
|
run-build-usage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v3.5.3
|
||||||
|
|
||||||
|
- name: Use the action with run build enabled
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
source-dir: test
|
||||||
|
run-build: true
|
||||||
|
|
||||||
|
- name: Test the project
|
||||||
|
run: ctest --test-dir build --output-on-failure --no-tests=error
|
||||||
|
|
||||||
|
run-test-usage:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout the repository
|
||||||
|
uses: actions/checkout@v3.5.3
|
||||||
|
|
||||||
|
- name: Use the action with run test enabled
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
source-dir: test
|
||||||
|
run-build: true
|
||||||
|
run-test: true
|
||||||
|
|
||||||
additional-flags-usage:
|
additional-flags-usage:
|
||||||
runs-on: ${{ matrix.compiler == 'msvc' && 'windows' || 'ubuntu' }}-latest
|
runs-on: ${{ matrix.compiler == 'msvc' && 'windows' || 'ubuntu' }}-latest
|
||||||
|
Loading…
Reference in New Issue
Block a user