diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d7e9371b..28156ba4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: AGPL-3.0-or-later # App maintainers -/appinfo/info.xml @kyteinsky @marcelklehr +* @kyteinsky @marcelklehr diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 00000000..a52e7451 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,93 @@ +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: Static Analysis + +on: + pull_request: + branches: + - master + push: + branches: + - master + +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 + + - 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 + 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