Skip to content

Commit b0953a6

Browse files
committed
Add Python test Actions workflow
1 parent 57abd23 commit b0953a6

File tree

1 file changed

+213
-0
lines changed

1 file changed

+213
-0
lines changed

.github/workflows/python_test.yaml

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
name: Python test
2+
run-name: Python test PR${{ github.event.number }}
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
tags:
10+
- '*'
11+
pull_request:
12+
branches:
13+
- main
14+
15+
jobs:
16+
python-test:
17+
name: Python tests
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Git checkout
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: 'true'
24+
25+
- name: Get Python modules
26+
run: |
27+
python3 -m pip install --upgrade pip
28+
python3 -m pip install pycodestyle mypy
29+
30+
- name: Check code style
31+
run: |
32+
python3 -m pycodestyle --config .pycodestyle.ini ./*.py
33+
python3 -m pycodestyle --config .pycodestyle.ini ./lglpy
34+
python3 -m pycodestyle --config .pycodestyle.ini ./generator
35+
36+
- name: Check typing
37+
run: |
38+
python3 -m mypy ./*.py
39+
python3 -m mypy ./lglpy
40+
python3 -m mypy ./generator
41+
42+
- name: Run unit tests
43+
# Note: Only run tests that do not require a connected device
44+
run: |
45+
python3 -m lglpy.ui.test
46+
47+
build-ubuntu-x64-clang:
48+
name: Ubuntu x64 Clang
49+
runs-on: ubuntu-22.04
50+
steps:
51+
- name: Git checkout
52+
uses: actions/checkout@v4
53+
with:
54+
submodules: 'true'
55+
56+
- name: Build layer_example
57+
run: |
58+
export CC=clang
59+
export CXX=clang++
60+
mkdir layer_example/build_rel
61+
cd layer_example/build_rel
62+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
63+
make -j4
64+
65+
- name: Build layer_gpu_support
66+
run: |
67+
export CC=clang
68+
export CXX=clang++
69+
mkdir layer_gpu_support/build_rel
70+
cd layer_gpu_support/build_rel
71+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
72+
make -j4
73+
74+
- name: Build layer_gpu_timeline
75+
run: |
76+
export CC=clang
77+
export CXX=clang++
78+
mkdir layer_gpu_timeline/build_rel
79+
cd layer_gpu_timeline/build_rel
80+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
81+
make -j4
82+
83+
- name: Build layer_gpu_profile
84+
run: |
85+
export CC=clang
86+
export CXX=clang++
87+
mkdir layer_gpu_profile/build_rel
88+
cd layer_gpu_profile/build_rel
89+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
90+
make -j4
91+
92+
- name: Build and run unit tests
93+
run: |
94+
export CC=clang
95+
export CXX=clang++
96+
mkdir build_unittest
97+
cd build_unittest
98+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=./ ..
99+
make install -j4
100+
./bin/unittest_comms
101+
102+
build-ubuntu-x64-gcc:
103+
name: Ubuntu x64 GCC
104+
runs-on: ubuntu-22.04
105+
steps:
106+
- name: Git checkout
107+
uses: actions/checkout@v4
108+
with:
109+
submodules: 'true'
110+
111+
- name: Build layer_example
112+
run: |
113+
export CC=gcc
114+
export CXX=g++
115+
mkdir layer_example/build_rel
116+
cd layer_example/build_rel
117+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
118+
make -j4
119+
120+
- name: Build layer_gpu_support
121+
run: |
122+
export CC=gcc
123+
export CXX=g++
124+
mkdir layer_gpu_support/build_rel
125+
cd layer_gpu_support/build_rel
126+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
127+
make -j4
128+
129+
- name: Build layer_gpu_timeline
130+
run: |
131+
export CC=gcc
132+
export CXX=g++
133+
mkdir layer_gpu_timeline/build_rel
134+
cd layer_gpu_timeline/build_rel
135+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
136+
make -j4
137+
138+
- name: Build layer_gpu_profile
139+
run: |
140+
export CC=gcc
141+
export CXX=g++
142+
mkdir layer_gpu_profile/build_rel
143+
cd layer_gpu_profile/build_rel
144+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
145+
make -j4
146+
147+
build-android:
148+
name: Android
149+
runs-on: ubuntu-22.04
150+
steps:
151+
- name: Git checkout
152+
uses: actions/checkout@v4
153+
with:
154+
submodules: 'true'
155+
156+
- name: Build layer_example
157+
run: |
158+
cd layer_example
159+
bash ./android_build.sh Release
160+
161+
- name: Build layer_gpu_support
162+
run: |
163+
cd layer_gpu_support
164+
bash ./android_build.sh Release
165+
166+
- name: Build layer_gpu_timeline
167+
run: |
168+
cd layer_gpu_timeline
169+
bash ./android_build.sh Release
170+
171+
- name: Build layer_gpu_profile
172+
run: |
173+
cd layer_gpu_profile
174+
bash ./android_build.sh Release
175+
176+
build-ubuntu-x64-clang-new-common:
177+
name: Ubuntu x64 generate common
178+
runs-on: ubuntu-22.04
179+
steps:
180+
- name: Git checkout
181+
uses: actions/checkout@v4
182+
with:
183+
submodules: 'true'
184+
185+
- name: Generate layer_test
186+
run: |
187+
python3 ./generator/generate_vulkan_common.py
188+
mkdir layer_example/build_rel
189+
cd layer_example/build_rel
190+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
191+
make -j4
192+
193+
- name: Check unexpected diffs
194+
run: |
195+
git diff --exit-code
196+
197+
build-ubuntu-x64-clang-new-project:
198+
name: Ubuntu x64 generate new layer
199+
runs-on: ubuntu-22.04
200+
steps:
201+
- name: Git checkout
202+
uses: actions/checkout@v4
203+
with:
204+
submodules: 'true'
205+
206+
- name: Generate layer_test
207+
run: |
208+
python3 ./generator/generate_vulkan_common.py
209+
python3 ./generator/generate_vulkan_layer.py --project-name Test --layer-name VkLayerTest --output layer_test
210+
mkdir layer_test/build_rel
211+
cd layer_test/build_rel
212+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
213+
make -j4

0 commit comments

Comments
 (0)