-
Notifications
You must be signed in to change notification settings - Fork 8
47 lines (39 loc) · 1.22 KB
/
tools-tests.yml
File metadata and controls
47 lines (39 loc) · 1.22 KB
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
#
# This workflow is run for pull requests the modify the `tools` directory
# and runs tests for the Python scripts in that directory
#
name: "Test Python tools"
on:
workflow_dispatch: # manual trigger for debugging
push:
paths:
- 'tools/*'
- '.github/workflows/tools-test.yml' # modified workflow may affect tools
branches:
- main
pull_request:
paths:
- 'tools/*'
- '.github/workflows/tools-test.yml' # modified workflow may affect tools
jobs:
py311:
name: "Run tests"
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install -r tools/requirements.txt
python -m pip install pytest mock black isort
- name: Check code formatting
run: python -m black --check --diff tools
- name: Check imports
run: python -m isort --check --profile black tools
- name: Validate types
run: python -m mypy --disallow-untyped-calls --disallow-untyped-defs tools/*.py
- name: Run tests
run: python -m pytest tools/tests/test*.py -vv