Skip to content

Commit df22f0a

Browse files
Martin RevajJozefiel
authored andcommitted
pr_check action added
- check spelling issues - catch changes [subdirectories] - test code in parallel
1 parent 31cf2ae commit df22f0a

File tree

4 files changed

+103
-3
lines changed

4 files changed

+103
-3
lines changed

.github/.codespellignore

Whitespace-only changes.

.github/workflows/pr_check.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# NOTE: adding exceptions for codespell into .github/.codespellignore
2+
name: pr-check
3+
4+
on:
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
codespell:
11+
name: Check spelling issues in repository.
12+
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: codespell-project/actions-codespell@master
19+
with:
20+
ignore_words_file: .github/.codespellignore
21+
check_filenames: true
22+
check_hidden: false
23+
24+
changes:
25+
name: Catch sub-repository with changes.
26+
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 5
29+
outputs:
30+
python-workers: ${{ steps.python.outputs.changes }}
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: dorny/paths-filter@v2
34+
id: python
35+
with:
36+
filters: |
37+
inventory/python:
38+
- 'inventory/python/**'
39+
misc/python/http:
40+
- 'misc/python/http/**'
41+
misc/python/influxdb:
42+
- 'misc/python/influxdb/**'
43+
misc/python/kafka:
44+
- 'misc/python/kafka/**'
45+
resource-manager/python:
46+
- 'resource-manager/python/**'
47+
schellar/python:
48+
- 'schellar/python/**'
49+
topology-discovery/python:
50+
- 'topology-discovery/python/**'
51+
uniconfig/python:
52+
- 'uniconfig/python/**'
53+
54+
- name: Echoes changes.
55+
run: |
56+
echo "------------------------------------------------------------------------"
57+
echo "Caught changes in:" ${{ steps.python.outputs.changes }}
58+
echo "------------------------------------------------------------------------"
59+
60+
tests:
61+
name: Code testing in parallel.
62+
63+
needs: changes
64+
if: ${{ needs.changes.outputs.python-workers != '[]' && needs.changes.outputs.python-workers != '' }}
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
directories: ${{ fromJSON(needs.changes.outputs.python-workers) }}
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v3
72+
- uses: actions/setup-python@v4
73+
with:
74+
python-version: "3.10"
75+
- uses: abatilo/actions-poetry@v2
76+
with:
77+
poetry-version: "1.4.2"
78+
79+
- name: Install package dependencies.
80+
run: |
81+
poetry install --verbose
82+
working-directory: ${{ matrix.directories }}
83+
84+
- name: Run mypy.
85+
run: |
86+
poetry run mypy .
87+
working-directory: ${{ matrix.directories }}
88+
89+
- name: Run ruff.
90+
run: |
91+
poetry run ruff .
92+
working-directory: ${{ matrix.directories }}
93+
94+
- name: Run pyright.
95+
run: |
96+
poetry run pyright .
97+
working-directory: ${{ matrix.directories }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# test pr_check
2+
def foo() -> str:
3+
return 'baz'

misc/python/influxdb/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55
[tool.poetry.dependencies]
66
python = "^3.10"
77
pydantic = "^1.10.7"
8-
frinx-python-sdk = {git = "ssh://git@github.com/FRINXio/frinx-python-sdk.git", rev = "main"}
8+
frinx-python-sdk = {git = "https://github.com/FRINXio/frinx-python-sdk.git", rev = "main"}
99
influxdb-client = "^1.37.0"
1010

1111
[tool.poetry.group.dev.dependencies]
@@ -18,11 +18,11 @@ types-requests = "^2.31.0.2"
1818
[tool.poetry]
1919
packages = [{ include = "frinx_worker" }]
2020
name = "frinx-influxdb-worker"
21-
description = "Conductor HTTP worker for Frinx Machine"
21+
description = "Conductor InfluxDB worker for Frinx Machine"
2222
authors = ["Jozef Volak <[email protected]>"]
2323
version = "0.0.1" # dynamically generated
2424
readme = ["README.md", "CHANGELOG.md"]
25-
keywords = ["frinx-machine", "http", "worker"]
25+
keywords = ["frinx-machine", "influx", "worker"]
2626
license = "Apache 2.0"
2727

2828
[project.urls]

0 commit comments

Comments
 (0)