forked from srcML/srcML
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (87 loc) · 2.9 KB
/
TestParser.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
---
name: Test Parser
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
- name: Cache Build
id: cache
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-client1
- name: Setup Ubuntu
shell: bash
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
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
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: |
brew install ninja antlr2
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
if: ${{ !steps.cache.outputs.cache-hit }}
run: mkdir build
- name: Build on Windows
shell: bash
if: ${{ matrix.os == 'windows-latest' }}
working-directory: build
run: |
export UseMultiToolTask=true
cmake ..
cmake --build . --config Release --target install
- name: Build on Ubuntu/macOS
shell: bash
if: ${{ matrix.os != 'windows-latest' }}
working-directory: build
run: |
cmake .. -G Ninja
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: 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