This repository was archived by the owner on Apr 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (81 loc) · 2.37 KB
/
pr-check.yml
File metadata and controls
85 lines (81 loc) · 2.37 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: pr-check
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
codespell:
name: Codespell
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Codespell
uses: codespell-project/actions-codespell@master
with:
ignore_words_list: .codespellignore
check_filenames: true
check_hidden: false
skip: "*.patch"
changes:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
python-api-packages: ${{ steps.python.outputs.changes }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: python
with:
filters: |
frinx-inventory-server/python:
- 'frinx-inventory-server/python/**'
resource-manager/python:
- 'resource-manager/python/**'
schellar/python:
- 'schellar/python/**'
topology-discovery/python:
- 'topology-discovery/python/**'
performance-monitor/python:
- 'performance-monitor/python/**'
blueprints-provider/python:
- 'blueprints-provider/python/**'
uniconfig/python:
- 'uniconfig/python/**'
utils/graphql-pydantic-converter:
- 'utils/graphql-pydantic-converter/**'
code-validate:
name: Validate api packages
runs-on: ubuntu-latest
timeout-minutes: 5
needs: changes
if: ${{ needs.changes.outputs.python-api-packages != '[]' && needs.changes.outputs.python-api-packages != '' }}
strategy:
fail-fast: false
matrix:
directories: ${{ fromJSON(needs.changes.outputs.python-api-packages) }}
defaults:
run:
working-directory: ${{ matrix.directories }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "2.0.1"
- name: Install package dependencies.
run: poetry install
- name: Run mypy.
run: poetry run mypy .
- name: Run ruff.
run: poetry run ruff .
- name: Run pyright.
run: poetry run pyright .
- name: Run pytests.
run: |
if [[ -d tests ]]; then
poetry run pytest . -vv
fi