Skip to content

Commit c066080

Browse files
committed
Add Test Ubuntu action
1 parent 95ae580 commit c066080

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

.github/workflows/TestUbuntu.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
name: Test Ubuntu
3+
4+
on: workflow_dispatch
5+
6+
jobs:
7+
package:
8+
strategy:
9+
matrix:
10+
distribution: ["ubuntu:18.04", "ubuntu:20.04", "ubuntu:20.10", "ubuntu:21.04", "ubuntu:21.10"]
11+
runs-on: ubuntu-latest
12+
container: srcml/${{ matrix.distribution }}
13+
timeout-minutes: 10
14+
steps:
15+
16+
- name: Checkout Repository
17+
uses: actions/checkout@v2
18+
19+
- name: OS Version
20+
shell: bash
21+
run: |
22+
cat /etc/os-release
23+
export VALUE=$(echo ${{ matrix.distribution }} | tr ':' '-')
24+
echo "LABEL=$VALUE" >> $GITHUB_ENV
25+
26+
- name: Create build directory
27+
shell: bash
28+
run: mkdir build
29+
30+
- name: CMake Setup
31+
shell: bash
32+
working-directory: build
33+
run: |
34+
cmake .. -G Ninja
35+
36+
- name: Build
37+
shell: bash
38+
working-directory: build
39+
run: |
40+
ninja
41+
42+
- name: Package
43+
shell: bash
44+
working-directory: build
45+
run: |
46+
cpack -G DEB
47+
48+
- uses: actions/upload-artifact@v2
49+
with:
50+
name: FedoraDist
51+
path: build/dist/*.deb
52+
53+
- name: Install using packages
54+
shell: bash
55+
run: |
56+
sudo apt install ./build/dist/srcml*.rpm
57+
58+
- name: Run Installed srcml
59+
shell: bash
60+
working-directory: build
61+
run: |
62+
srcml --version
63+
srcml --text="int a;" -l C++
64+
65+
- name: Client Tests on Installed srcml
66+
shell: bash
67+
working-directory: build
68+
continue-on-error: true
69+
run: |
70+
ctest -VV
71+
- run: cp build/Testing/Temporary/LastTest.log build/Testing/ClientTest.${{ env.LABEL }}.log
72+
- uses: actions/upload-artifact@v2
73+
with:
74+
name: ClientTests
75+
path: build/Testing/ClientTest.${{ env.LABEL }}.log
76+
77+
- name: Build libsrcml Tests
78+
shell: bash
79+
working-directory: build
80+
continue-on-error: true
81+
run: |
82+
cmake .. -DBUILD_LIBSRCML_TESTS=ON
83+
cmake --build . --config Release --target build_libsrcml_tests
84+
85+
- name: Run libsrcml Tests on Installed libsrcml
86+
shell: bash
87+
working-directory: build
88+
continue-on-error: true
89+
run: |
90+
ctest -R ^test_
91+
- run: cp build/Testing/Temporary/LastTest.log build/Testing/libsrcmlTest.${{ env.LABEL }}.log
92+
- uses: actions/upload-artifact@v2
93+
with:
94+
name: libsrcmlTests
95+
path: build/Testing/libsrcmlTest.${{ env.LABEL }}.log
96+
97+
- name: Generate Parser Tests
98+
shell: bash
99+
working-directory: build
100+
run: |
101+
cmake .. -DBUILD_PARSER_TESTS=ON
102+
cmake --build . --config Release --target gen_parser_tests
103+
104+
- name: Run Parser Tests
105+
shell: bash
106+
working-directory: build
107+
continue-on-error: true
108+
run: |
109+
srcml --dev --parser-test test/parser/testsuite | tee ParserTest.log
110+
- run: cp build/ParserTest.log build/libsrcmlTest.${{ env.LABEL }}.log
111+
- uses: actions/upload-artifact@v2
112+
with:
113+
name: ParserTests
114+
path: build/libsrcmlTest.${{ env.LABEL }}.log

0 commit comments

Comments
 (0)