Skip to content

Commit be525d1

Browse files
authored
enh: add static analysis with pyright (#171)
2 parents 2b42c8a + c4dfa31 commit be525d1

2 files changed

Lines changed: 94 additions & 1 deletion

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
22
# SPDX-License-Identifier: AGPL-3.0-or-later
33
# App maintainers
4-
/appinfo/info.xml @kyteinsky @marcelklehr
4+
* @kyteinsky @marcelklehr
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
4+
name: Static Analysis
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- master
10+
push:
11+
branches:
12+
- master
13+
14+
permissions:
15+
contents: read
16+
17+
concurrency:
18+
group: static-analysis-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
changes:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
pull-requests: read
27+
28+
outputs:
29+
src: ${{ steps.changes.outputs.src}}
30+
31+
steps:
32+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
33+
id: changes
34+
continue-on-error: true
35+
with:
36+
filters: |
37+
src:
38+
- 'main.py'
39+
- 'main_em.py'
40+
- 'config.cpu.yaml'
41+
- 'config.gpu.yaml'
42+
- 'context_chat_backend/**'
43+
- 'appinfo/**'
44+
- 'example.env'
45+
- 'hwdetect.sh'
46+
- 'persistent_storage/**'
47+
- 'project.toml'
48+
- 'requirements.txt'
49+
- 'logger_config.yaml'
50+
- '.github/workflows/static-analysis.yml'
51+
52+
analysis:
53+
runs-on: ubuntu-latest
54+
55+
needs: changes
56+
if: needs.changes.outputs.src != 'false'
57+
58+
steps:
59+
- name: Checkout CCB
60+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
61+
62+
- name: Setup python 3.11
63+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
64+
with:
65+
python-version: '3.11'
66+
cache: 'pip'
67+
cache-dependency-path: |
68+
requirements.txt
69+
requirements_dev.txt
70+
71+
- name: Install dependencies
72+
run: |
73+
pip install --upgrade pip setuptools wheel
74+
pip install -r requirements_dev.txt
75+
76+
- name: Static analysis with pyright
77+
run: |
78+
pyright
79+
80+
summary:
81+
permissions:
82+
contents: none
83+
runs-on: ubuntu-latest-low
84+
needs: [changes, analysis]
85+
86+
if: always()
87+
88+
# This is the summary, we just avoid to rename it so that branch protection rules still match
89+
name: static-analysis
90+
91+
steps:
92+
- name: Summary status
93+
run: if ${{ needs.changes.outputs.src != 'false' && needs.analysis.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)