Skip to content

Commit 4185152

Browse files
committed
Add Python test Actions workflow
1 parent 69947c2 commit 4185152

File tree

2 files changed

+49
-31
lines changed

2 files changed

+49
-31
lines changed

.github/workflows/build_test.yaml

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,15 @@ on:
88
- main
99
tags:
1010
- '*'
11+
paths-ignore:
12+
- 'lglpy/**'
1113
pull_request:
1214
branches:
1315
- main
16+
paths-ignore:
17+
- 'lglpy/**'
1418

1519
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-
4720
build-ubuntu-x64-clang:
4821
name: Ubuntu x64 Clang
4922
runs-on: ubuntu-22.04

.github/workflows/python_test.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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

0 commit comments

Comments
 (0)