-
Notifications
You must be signed in to change notification settings - Fork 4
135 lines (118 loc) · 3.94 KB
/
test.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build and test
on:
push:
branches: [dev]
env:
build_dir: build
build_config: Release
cflags_gnuc: -Werror -fsanitize=address
lflags_gnuc: -fsanitize=address
cflags_msvc: /WX
lflags_msvc: ''
doxygen_version: ${{secrets.doxygen_version}}
jobs:
build:
name: Build and test
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
lib_type: [STATIC, SHARED]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure runner
run: |
if [ $RUNNER_OS == 'Windows' ]; then
echo 'cflags="${{env.cflags_msvc}}"' >> $GITHUB_ENV
echo 'lflags="${{env.lflags_msvc}}"' >> $GITHUB_ENV
choco install winflexbison3
else
echo 'cflags="${{env.cflags_gnuc}}"' >> $GITHUB_ENV
echo 'lflags="${{env.lflags_gnuc}}"' >> $GITHUB_ENV
if [ $RUNNER_OS == 'macOS' ]; then
brew install flex bison
echo '/usr/local/opt/bison/bin' >> $GITHUB_PATH
echo '/usr/local/opt/flex/bin' >> $GITHUB_PATH
fi
fi
shell: bash
- name: Configure CMake
run: >
cmake -B ${{env.build_dir}}
-DULIB_LEAKS=ON
-DULIB_LIBRARY_TYPE=${{matrix.lib_type}}
-DCOWL_LIBRARY_TYPE=${{matrix.lib_type}}
-DCOWL_ENTITY_IDS=ON
-DCMAKE_SYSTEM_VERSION=''
-DCMAKE_BUILD_TYPE=${{env.build_config}}
-DCMAKE_C_FLAGS=${{env.cflags}}
-DCMAKE_CXX_FLAGS=${{env.cflags}}
-DCMAKE_SHARED_LINKER_FLAGS=${{env.lflags}}
-DCMAKE_EXE_LINKER_FLAGS=${{env.lflags}}
- name: Build
run: >
cmake --build ${{env.build_dir}}
--config ${{env.build_config}}
--target cowl-test cowl-cpp-test cowl-bench cowl-examples cowl-tools
- name: Configure tests
working-directory: ${{env.build_dir}}
if: matrix.os == 'windows-latest'
run: |
mv test/${{env.build_config}}/*.exe test
mv examples/${{env.build_config}}/*.exe examples
mv tools/${{env.build_config}}/*.exe tools
if [ ${{matrix.lib_type}} == 'SHARED' ]; then
find . -name '*.dll' -exec cp -t test {} + -exec cp -t examples {} + -exec cp -t tools {} +
fi
shell: bash
- name: Run tests
working-directory: ${{env.build_dir}}/test
run: ./cowl-test
- name: Run tests (C++)
working-directory: ${{env.build_dir}}/test
run: ./cowl-cpp-test
- name: Run benchmark
working-directory: ${{env.build_dir}}/test
run: ./cowl-bench
- name: Run examples
working-directory: ${{env.build_dir}}/examples
run: |
if [ $RUNNER_OS == 'Windows' ]; then
EXAMPLES=(./*-example.exe)
else
EXAMPLES=(./*-example)
fi
for EXAMPLE in "${EXAMPLES[@]}"; do
"${EXAMPLE}"
done
shell: bash
- name: Run tools
working-directory: ${{env.build_dir}}/tools
run: ./cowl-stats test_onto.owl
docs:
name: Generate the documentation
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure runner
run: |
brew update
if [ -z ${{env.doxygen_version}} ]; then
brew install doxygen
else
brew tap-new cowl/doxygen
brew extract --version=${{env.doxygen_version}} doxygen cowl/doxygen
brew install doxygen@${{env.doxygen_version}}
fi
pip3 install -U Sphinx sphinx-rtd-theme breathe
- name: Build docs
run: |
cmake -B ${{env.build_dir}} -DCOWL_READERS=''
cmake --build ${{env.build_dir}} --target cowl-docs