Skip to content

Commit a8102a0

Browse files
authored
Re-enable linting action (#102)
* Re-enable linting action Also changes install script to exclude dev dependencies. * update action versions * remove accidentally included changes
1 parent de29047 commit a8102a0

6 files changed

Lines changed: 35 additions & 16 deletions

File tree

.github/workflows/python-lint.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: Python Linting
22

33
on:
44
pull_request:
5-
branches:
6-
- develop
7-
push:
8-
branches:
9-
- develop
105

116
jobs:
127
run-linters:
@@ -15,16 +10,13 @@ jobs:
1510

1611
steps:
1712
- name: Check out Git repository
18-
uses: actions/checkout@v3
13+
uses: actions/checkout@v7
1914

2015
- name: Set up Python
21-
uses: actions/setup-python@v1
16+
uses: actions/setup-python@v6
2217
with:
2318
python-version: "3.10"
2419

25-
- name: Install Python dependencies
26-
run: pip install black flake8 mypy pydantic types-requests
27-
2820
- name: Install Poetry
2921
uses: snok/install-poetry@v1
3022
with:
@@ -34,7 +26,7 @@ jobs:
3426

3527
- name: Load cached venv
3628
id: cached-poetry-dependencies
37-
uses: actions/cache@v2
29+
uses: actions/cache@v6
3830
with:
3931
path: .venv
4032
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
@@ -44,7 +36,7 @@ jobs:
4436
run: poetry install --no-interaction --no-root
4537

4638
- name: Run linters
47-
uses: wearerequired/lint-action@v1
39+
uses: wearerequired/lint-action@v2
4840
with:
4941
github_token: ${{ secrets.github_token }}
5042
# Enable linters

.github/workflows/python-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: poetry install --no-interaction --no-root
3737

3838
- name: Run tests
39-
run: ./scripts/run_pytest.sh
39+
run: ./scripts/run_pytest.sh --junitxml=report.xml
4040

4141
- name: Upload coverage report
4242
uses: actions/upload-artifact@v4
@@ -45,4 +45,5 @@ jobs:
4545
name: coverage-report
4646
path: |
4747
coverage.xml
48+
report.xml
4849
htmlcov/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Test Report'
2+
on:
3+
workflow_run:
4+
workflows: ['Python Tests']
5+
types:
6+
- completed
7+
permissions:
8+
contents: read
9+
actions: read
10+
checks: write
11+
jobs:
12+
report:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: dorny/test-reporter@v3
16+
with:
17+
artifact: coverage-report
18+
name: Python Tests
19+
path: 'report.xml'
20+
reporter: python-xunit

scripts/th_cli_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if ! command -v poetry &> /dev/null; then
7070
exit 1
7171
fi
7272
poetry self update
73-
poetry --project="$PROJECT_ROOT" install
73+
poetry --project="$PROJECT_ROOT" install --without dev
7474

7575
# Build the package
7676
echo "Building package..."

tests/test_run/camera/test_two_way_talk_handler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import pytest
2727

28-
import th_cli.test_run.camera.two_way_talk_handler as _module
2928
from th_cli.test_run.camera.two_way_talk_handler import TwoWayTalkHandler, TwoWayTalkHTTPHandler
3029

3130
# ---------------------------------------------------------------------------

th_cli/commands/run_tests.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@
4242
from th_cli.exceptions import CLIError, handle_api_error
4343
from th_cli.test_run.camera.two_way_talk_handler import TwoWayTalkHandler
4444
from th_cli.test_run.websocket import TestRunSocket
45-
from th_cli.utils import DEFAULT_CLI_PROJECT_NAME, build_test_selection, convert_nested_to_dict, load_json_config, merge_configs, read_pics_config
45+
from th_cli.utils import (
46+
DEFAULT_CLI_PROJECT_NAME,
47+
build_test_selection,
48+
convert_nested_to_dict,
49+
load_json_config,
50+
merge_configs,
51+
read_pics_config,
52+
)
4653
from th_cli.validation import validate_directory_path, validate_file_path, validate_test_ids
4754

4855
# Constants

0 commit comments

Comments
 (0)