Fix lupdate JSON path and add weekly schedule #13
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
| name: pre-commit | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'Stable*' | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@v2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Get build config | |
| id: config | |
| uses: ./.github/actions/build-config | |
| - name: Setup Python | |
| uses: ./.github/actions/setup-python | |
| with: | |
| groups: precommit | |
| python-version: '3.12' | |
| - name: Restore pre-commit cache (PR) | |
| if: github.event_name == 'pull_request' | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Cache pre-commit hooks (push) | |
| if: github.event_name != 'pull_request' | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Install Qt (for qmllint) | |
| uses: ./.github/actions/qt-install | |
| with: | |
| version: ${{ steps.config.outputs.qt_version }} | |
| host: linux | |
| arch: linux_gcc_64 | |
| modules: '' | |
| archives: qtbase qtdeclarative icu | |
| - name: Run pre-commit | |
| id: pre-commit | |
| continue-on-error: true | |
| env: | |
| PRE_COMMIT_OUTPUT: pre-commit-output.txt | |
| run: python3 ./tools/pre_commit.py --ci | |
| - name: Prepare pre-commit results artifact | |
| if: github.event_name == 'pull_request' && always() | |
| env: | |
| EXIT_CODE: ${{ steps.pre-commit.outputs.exit_code }} | |
| PASSED: ${{ steps.pre-commit.outputs.passed }} | |
| FAILED: ${{ steps.pre-commit.outputs.failed }} | |
| SKIPPED: ${{ steps.pre-commit.outputs.skipped }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| python3 "${GITHUB_WORKSPACE}/.github/scripts/precommit_results.py" \ | |
| --output-dir pre-commit-results \ | |
| --exit-code "${EXIT_CODE:-1}" \ | |
| --passed "${PASSED:-0}" \ | |
| --failed "${FAILED:-0}" \ | |
| --skipped "${SKIPPED:-0}" \ | |
| --run-url "${RUN_URL}" \ | |
| --output-file pre-commit-output.txt | |
| - name: Upload pre-commit results artifact | |
| if: github.event_name == 'pull_request' && always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: pre-commit-results | |
| path: pre-commit-results | |
| retention-days: 7 |