Repository navigation
fix(translations): authorize source target fanout #39956
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright © Michal Čihař <michal@weblate.org> | |
| # | |
| # SPDX-License-Identifier: CC0-1.0 | |
| name: mypy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - stable | |
| pull_request: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| mypy: | |
| runs-on: ubuntu-26.04 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Get changed files | |
| if: github.event_name == 'pull_request' | |
| id: changed-files | |
| uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6 | |
| with: | |
| files: '**.py' | |
| use_rest_api: true | |
| - name: List all changed files | |
| if: github.event_name == 'pull_request' | |
| env: | |
| ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
| run: | | |
| touch changed-files.txt | |
| for file in ${ALL_CHANGED_FILES}; do | |
| echo "$file" >> changed-files.txt | |
| done | |
| cat changed-files.txt | |
| - name: Install apt dependencies | |
| uses: $/.github/actions/apt-install | |
| - name: Setup Python | |
| id: setup_python | |
| uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 | |
| with: | |
| python-version: '3.14' | |
| - uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0 | |
| with: | |
| enable-cache: false | |
| cache-local-path: ${{ runner.temp }}/weblate-uv-cache | |
| version: 0.13.10 | |
| - name: Restore Python dependencies | |
| id: python-cache | |
| uses: $/.github/actions/python-cache-restore | |
| with: | |
| python-version: ${{ steps.setup_python.outputs.python-version }} | |
| - name: Install deps | |
| run: uv sync --frozen --no-binary-package lxml --no-binary-package xmlsec --all-extras --group types | |
| - name: Save Python dependencies | |
| uses: $/.github/actions/python-cache-save | |
| with: | |
| primary-key: ${{ steps.python-cache.outputs.primary-key }} | |
| exact-hit: ${{ steps.python-cache.outputs.exact-hit }} | |
| cache-directory: ${{ steps.python-cache.outputs.cache-directory }} | |
| - name: Run and enforce mypy | |
| run: uv run --no-sync python .devcontainer/mypy_check.py --output mypy.log | |
| - name: Report mypy | |
| run: | | |
| echo "::add-matcher::.github/matchers/mypy.json" | |
| if [ -f changed-files.txt ] ; then | |
| if grep --silent --fixed-strings --file=changed-files.txt mypy.log ; then | |
| grep --fixed-strings --file=changed-files.txt mypy.log | |
| fi | |
| else | |
| cat mypy.log | |
| fi | |
| echo "::remove-matcher owner=mypy::" |