forked from srcML/srcML
-
Notifications
You must be signed in to change notification settings - Fork 0
240 lines (213 loc) · 6.66 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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
---
name: Test
on: workflow_dispatch
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout Repository
uses: actions/checkout@v2
<<<<<<< HEAD
- name: Cache Build
id: cache
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-client1
=======
>>>>>>> upstream/issue1942
- name: Setup Ubuntu
shell: bash
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
<<<<<<< HEAD
sudo apt update
sudo apt install curl zip g++ make ninja-build antlr libantlr-dev \
libxml2-dev libxml2-utils libxslt1-dev \
libarchive-dev libssl-dev libcurl4-openssl-dev \
cpio man file dpkg-dev
=======
sudo apt install antlr libantlr-dev libantlr-java libarchive-dev \
libcurl4-openssl-dev libxml2-utils libxslt1-dev \
ninja-build
>>>>>>> upstream/issue1942
curl -L http://www.sdml.cs.kent.edu/build/srcML-1.0.0-Boost.tar.gz | \
sudo tar xz -C /usr/local/include
- name: Setup macOS
shell: bash
if: ${{ matrix.os == 'macos-latest' }}
run: |
<<<<<<< HEAD
brew install ninja antlr2
=======
brew install ninja antlr2 --display-times
>>>>>>> upstream/issue1942
curl -L http://www.sdml.cs.kent.edu/build/srcML-1.0.0-Boost.tar.gz | \
sudo tar xz -C /usr/local/include
- name: Setup Windows
uses: microsoft/setup-msbuild@v1
if: ${{ matrix.os == 'windows-latest' }}
- name: Create build directory
shell: bash
<<<<<<< HEAD
if: ${{ !steps.cache.outputs.cache-hit }}
run: mkdir build
- name: Build on Windows
=======
run: mkdir build
- name: CMake Setup on Windows
>>>>>>> upstream/issue1942
shell: bash
if: ${{ matrix.os == 'windows-latest' }}
working-directory: build
run: |
<<<<<<< HEAD
cmake ..
cmake --build . --config Release --target install
- name: Build on Ubuntu/macOS
=======
export UseMultiToolTask=true
cmake ..
- name: CMake Setup on Ubuntu/macOS
>>>>>>> upstream/issue1942
shell: bash
if: ${{ matrix.os != 'windows-latest' }}
working-directory: build
run: |
cmake .. -G Ninja
<<<<<<< HEAD
sudo cmake --build . --config Release --target install
- name: Finish install for Ubuntu
shell: bash
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: build
run: |
sudo ldconfig
=======
- name: Build
shell: bash
working-directory: build
run: |
export UseMultiToolTask=true
cmake --build . --config Release
- name: Install on Windows
shell: bash
if: ${{ matrix.os == 'windows-latest' }}
working-directory: build
run: |
cmake --build . --config Release --target install
- name: Install on Ubuntu/macOS
shell: bash
if: ${{ matrix.os != 'windows-latest' }}
working-directory: build
run: |
sudo cmake --build . --config Release --target install
- name: Set PATH for Windows
shell: bash
if: ${{ matrix.os == 'windows-latest' }}
working-directory: build
run: |
echo "/c/Program Files (x86)/srcML/bin" >> $GITHUB_PATH
- name: Run Installed srcml
shell: bash
working-directory: build
run: |
srcml --version
srcml --text="int a;" -l C++
>>>>>>> upstream/issue1942
- name: Setup msys2 with additional client-test packages for Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: msys2/setup-msys2@v2
with:
install: >-
zip
cpio
diffutils
cmake
util-linux
- name: Windows Client Tests on Installed srcml
if: ${{ matrix.os == 'windows-latest' }}
shell: msys2 {0}
working-directory: build
timeout-minutes: 5
continue-on-error: true
run: |
export SRCML_HOME="/c/Program Files (x86)/srcML/bin"
ctest -C Release -VV
- uses: actions/upload-artifact@v2
with:
<<<<<<< HEAD
name: ClientLastTest.${{ runner.os }}.log
=======
name: ClientTest.${{ runner.os }}.log
>>>>>>> upstream/issue1942
path: build/Testing/Temporary/LastTest.log
- name: Ubuntu/macOS Client Tests on Installed srcml
if: ${{ matrix.os != 'windows-latest' }}
shell: bash
working-directory: build
<<<<<<< HEAD
=======
continue-on-error: true
>>>>>>> upstream/issue1942
run: |
ctest -VV
- uses: actions/upload-artifact@v2
with:
<<<<<<< HEAD
name: ClientLastTest.${{ runner.os }}.log
=======
name: ClientTest.${{ runner.os }}.log
>>>>>>> upstream/issue1942
path: build/Testing/Temporary/LastTest.log
- name: Build libsrcml Tests
shell: bash
working-directory: build
continue-on-error: true
run: |
<<<<<<< HEAD
=======
export UseMultiToolTask=true
>>>>>>> upstream/issue1942
cmake .. -DBUILD_LIBSRCML_TESTS=ON
cmake --build . --config Release --target build_libsrcml_tests
- name: Run libsrcml Tests on Installed libsrcml
shell: bash
working-directory: build
continue-on-error: true
run: |
ctest -C Release -R ^test_
- uses: actions/upload-artifact@v2
with:
<<<<<<< HEAD
name: libsrcmlLastTest.${{ runner.os }}.log
=======
name: libsrcmlTest.${{ runner.os }}.log
>>>>>>> upstream/issue1942
path: build/Testing/Temporary/LastTest.log
- name: Generate Parser Tests
shell: bash
working-directory: build
run: |
cmake .. -DBUILD_PARSER_TESTS=ON
cmake --build . --config Release --target gen_parser_tests
- name: Set PATH for Windows
shell: bash
if: ${{ matrix.os == 'windows-latest' }}
working-directory: build
run: |
echo "/c/Program Files (x86)/srcML/bin" >> $GITHUB_PATH
- name: Run Parser Tests
shell: bash
working-directory: build
continue-on-error: true
run: |
srcml --parser-test test/parser/testsuite | tee ParserTest.log
- uses: actions/upload-artifact@v2
with:
name: ParserTest.${{ runner.os }}.log
path: build/ParserTest.log