-
Notifications
You must be signed in to change notification settings - Fork 16
97 lines (80 loc) · 2.51 KB
/
static-analysis.yml
File metadata and controls
97 lines (80 loc) · 2.51 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
86
87
88
89
90
91
92
93
94
95
96
97
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Static Analysis
on:
pull_request:
push:
branches:
- master
- stable*
permissions:
contents: read
concurrency:
group: static-analysis-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
src: ${{ steps.changes.outputs.src}}
steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
continue-on-error: true
with:
filters: |
src:
- 'main.py'
- 'main_em.py'
- 'config.cpu.yaml'
- 'config.gpu.yaml'
- 'context_chat_backend/**'
- 'appinfo/**'
- 'example.env'
- 'hwdetect.sh'
- 'persistent_storage/**'
- 'project.toml'
- 'requirements.txt'
- 'logger_config.yaml'
- '.github/workflows/static-analysis.yml'
analysis:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.src != 'false'
steps:
- name: Checkout CCB
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
persist-credentials: false
- name: Setup python 3.11
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: |
requirements.txt
requirements_dev.txt
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
# use the cpu version of torch to not run out of space
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
sed -i '/torch(vision)?/d' requirements.txt
pip install -r requirements_dev.txt
- name: Static analysis with pyright
run: |
pyright
summary:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: [changes, analysis]
if: always()
# This is the summary, we just avoid to rename it so that branch protection rules still match
name: static-analysis
steps:
- name: Summary status
run: if ${{ needs.changes.outputs.src != 'false' && needs.analysis.result != 'success' }}; then exit 1; fi