-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (93 loc) · 3.58 KB
/
run-unit-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
name: Run Unit Tests
on:
workflow_dispatch:
pull_request:
paths:
- '**CMakeLists.txt'
- src/**.h
- src/**.cpp
- src/**.java
- src/**.dd
- src/**.inc
- src/**.lex
- src/**.yac
- test/**.h
- test/**.cpp
# Cancel any ongoing run of this workflow on the same PR or ref
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
}}
cancel-in-progress: true
jobs:
run-unit-tests:
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
build-setup:
- {os: windows-2022, cmake-preset: windows-msvc-debug}
- {os: ubuntu-latest, cmake-preset: linux-gcc-debug}
- {os: macos-latest, cmake-preset: macos-clang-debug}
runs-on: ${{ matrix.build-setup.os }}
permissions:
id-token: write
contents: read
checks: write
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Build Khiops test executables
uses: ./.github/actions/build-khiops
with:
preset-name: ${{ matrix.build-setup.cmake-preset }}
targets: norm_test parallel_test parallel_mpi_test learning_test KNITest
override-flags: -DTESTING=ON
- name: Run Unit Tests
run: |
ctest --preset ${{ matrix.build-setup.cmake-preset }} --output-junit junit.xml
# - name: Run Unit Tests for the Norm Module
# run: |
# build/${{ matrix.build-setup.cmake-preset }}/bin/norm_test \
# --gtest_output="xml:reports/report-norm.xml"
# - name: Run Unit Tests for the Parallel Module
# if: always()
# run: |
# build/${{ matrix.build-setup.cmake-preset }}/bin/parallel_test \
# --gtest_output="xml:reports/report-parallel.xml"
# - name: Run Unit Tests for the Parallel MPI Module in serial
# if: always()
# run: |
# build/${{ matrix.build-setup.cmake-preset }}/bin/parallel_mpi_test \
# --gtest_output="xml:reports/report-parallel-mpi-serial.xml"
# - name: Run Unit Tests for the Parallel MPI Module in parallel (Linux)
# if: ${{ always() && runner.os == 'Linux' }}
# run: |
# mpirun --oversubscribe --use-hwthread-cpus -n 4 build/${{ matrix.build-setup.cmake-preset }}/bin/parallel_mpi_test \
# --gtest_output="xml:reports/report-parallel-mpi-parallel.xml"
# - name: Run Unit Tests for the Parallel MPI Module in parallel (Windows and
# macOS)
# if: ${{ always() && runner.os != 'Linux' }}
# run: |
# mpiexec -n 4 build/${{ matrix.build-setup.cmake-preset }}/bin/parallel_mpi_test \
# --gtest_output="xml:reports/report-parallel-mpi-parallel.xml"
# - name: Run Unit Tests for the Learning Module
# if: always()
# run: |
# build/${{ matrix.build-setup.cmake-preset }}/bin/learning_test \
# --gtest_output="xml:reports/report-learning.xml"
# - name: Run Unit Tests for the KNI Module
# if: always()
# run: |
# build/${{ matrix.build-setup.cmake-preset }}/bin/KNITest \
# --gtest_output="xml:reports/report-kni.xml"
# - name: Create Unit Test Reports Dashboards
# uses: phoenix-actions/test-reporting@v14
# if: always()
# with:
# name: Unit Tests Reports (${{ matrix.build-setup.os }})
# reporter: jest-junit
# path: build/${{ matrix.build-setup.cmake-preset }}/junit.xml
# path-replace-backslashes: 'true' # Necessary for windows paths