2022-02-03 11:00:56 +08:00
|
|
|
name: CMake
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
|
|
|
|
env:
|
|
|
|
config: Release
|
|
|
|
build_dir: build
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Configure
|
|
|
|
working-directory: ${{ github.workspace }}/dlib/test
|
|
|
|
run: cmake . -B ${{ env.build_dir }}
|
|
|
|
|
2022-02-07 08:47:05 +08:00
|
|
|
- name: Build just tests
|
2022-02-03 11:00:56 +08:00
|
|
|
working-directory: ${{ github.workspace }}/dlib/test
|
2022-02-07 08:48:18 +08:00
|
|
|
run: cmake --build ${{ env.build_dir }} --config ${{ env.config }} --target dtest --parallel 8
|
2022-02-03 11:00:56 +08:00
|
|
|
|
|
|
|
- name: Test
|
|
|
|
working-directory: ${{ github.workspace }}/dlib/test/${{ env.build_dir }}
|
|
|
|
run: |
|
|
|
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
2022-02-03 21:26:50 +08:00
|
|
|
./${{ env.config }}/dtest.exe --runall -q
|
2022-02-03 11:00:56 +08:00
|
|
|
elif [ "$RUNNER_OS" == "macOS" ]; then
|
2022-02-03 21:26:50 +08:00
|
|
|
./dtest --runall --no_test_timer -q
|
2022-02-03 11:00:56 +08:00
|
|
|
else
|
2022-02-03 21:26:50 +08:00
|
|
|
./dtest --runall -q
|
2022-02-03 11:00:56 +08:00
|
|
|
fi;
|
2022-02-07 08:47:05 +08:00
|
|
|
|
|
|
|
- name: Build examples, etc
|
|
|
|
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
|
|
|
|
working-directory: ${{ github.workspace }}/dlib/test
|
2022-02-07 08:48:18 +08:00
|
|
|
run: cmake --build ${{ env.build_dir }} --config ${{ env.config }} --parallel 8
|