-
Notifications
You must be signed in to change notification settings - Fork 12
217 lines (174 loc) · 6.76 KB
/
CI.yaml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: CI
run-name: "${{ github.actor }} - ${{ github.event.head_commit.message }}"
on: push
jobs:
check-format:
strategy:
fail-fast: true
matrix:
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: run-clang-format
run: python3 scripts/run-clang-format.py -r example include src benchmark test data/include --exclude include/fls/json/nlohmann
build:
needs:
- check-format
strategy:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest, president, windows-latest ]
build_type: [ Debug, Release ]
cxx: [ clang++ ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Make directory build
run: mkdir ${{github.workspace}}/build_${{ matrix.build_type }}
- name: Install LLVM on macos
if: matrix.platform == 'macos-latest'
run: |
brew install llvm
- name: Add LLVM to path on macos
if: matrix.platform == 'macos-latest'
run: |
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
clang-tidy --version
- name: Install Chocolatey
if: matrix.platform == 'windows-latest'
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- name: Install Ninja on Windows
if: matrix.platform == 'windows-latest'
run: choco install ninja -y
# Verify Ninja installation on all platforms
- name: Verify Ninja installation
if: matrix.platform == 'windows-latest'
run: ninja --version
- name: Install Clang (with clang++)
if: matrix.platform == 'windows-latest'
run: choco install llvm -y
- name: Verify Clang++ installation
if: matrix.platform == 'windows-latest'
run: clang++ --version
- name: Configure CMake
if: matrix.platform != 'windows-latest'
run: |
cmake -S ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -B ${{github.workspace}}/build_${{ matrix.build_type }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
env:
CXX: ${{ matrix.cxx }}
- name: Configure CMake
if: matrix.platform == 'windows-latest'
run: |
cmake -S ${{github.workspace}} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -B ${{github.workspace}}/build_${{ matrix.build_type }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -G "Ninja" -DCMAKE_CXX_FLAGS="-target x86_64-w64-windows-gnu"
env:
CXX: ${{ matrix.cxx }}
- name: Build
run: cmake --build ${{github.workspace}}/build_${{ matrix.build_type }} -j 10
# build-iwyu:
# needs:
# - build
# # if: github.actor == 'azimafroozeh'
# strategy:
# fail-fast: true
# matrix:
# platform: [ ubuntu-latest, macos-latest]
# build_type: [ Release ]
# cxx: [ clang++ ]
# runs-on: ${{ matrix.platform }}
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - name: Make directory build
# run: mkdir ${{github.workspace}}/build_iwyu_${{ matrix.build_type }}
#
# - name: Configure CMake
# run: cmake -S ${{github.workspace}} -DFLS_ENABLE_IWYU=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -B ${{github.workspace}}/build_iwyu_${{ matrix.build_type }}
# env:
# CXX: ${{ matrix.cxx }}
#
# - name: Build
# run: cmake --build ${{github.workspace}}/build_iwyu_${{ matrix.build_type }} -j 10
generate_dataset:
needs: [ build ]
if: success()
strategy:
fail-fast: true
matrix:
platform: [ ubuntu-latest, macos-latest, president, windows-latest ]
python-version: [ 3.12.4 ] # Python 3 versions
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }} # Set Python 3.x version
- name: Install dependencies
run: |
python -m pip install --upgrade pip # Upgrade pip
pip install faker # Install faker
- name: generate data
run: cd ${{github.workspace}}/scripts/; python3 generate_synthetic_data.py
example:
needs:
- generate_dataset
strategy:
fail-fast: true
matrix:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
build_type: [ Debug ]
cc: [ clang ]
cxx: [ clang++ ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Make exmaple_build_${{ matrix.build_type }} directory
run: mkdir ${{github.workspace}}/example_build_${{ matrix.build_type }}
- name: Configure CMake
run: cmake -DFLS_BUILD_EXAMPLE=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{github.workspace}} -B ${{github.workspace}}/exmaple_build_${{ matrix.build_type }}
env:
CXX: ${{ matrix.cxx }}
CC: ${{matrix.cc}}
- name: Build
run: cmake --build ${{github.workspace}}/exmaple_build_${{ matrix.build_type }} -j 10
- name: run cpp_example
run: ${{github.workspace}}/exmaple_build_${{ matrix.build_type }}/example/cpp_example
test:
needs:
- example
strategy:
fail-fast: true
matrix:
platform: [ president ]
build_type: [ Release ] # TODO : ADD DEBUG
cxx: [ clang++ ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Make directory build
run: mkdir ${{github.workspace}}/test_build_${{ matrix.build_type }}
- name: Configure CMake
run: cmake -DFLS_BUILD_TESTING=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{github.workspace}} -B ${{github.workspace}}/test_build_${{ matrix.build_type }}
env:
CXX: ${{ matrix.cxx }}
- name: Build
run: cmake --build ${{github.workspace}}/test_build_${{ matrix.build_type }} -j 10
- name: Test
working-directory: ${{github.workspace}}/test_build_${{ matrix.build_type }}
run: ctest -j 96 --stop-on-failure --output-on-failure --timeout 5000