Update the cla-check #180
Workflow file for this run
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
| # ------------------------------------------------------------------------------ | |
| # (c) Crown copyright Met Office. All rights reserved. | |
| # The file LICENCE, distributed with this code, contains details of the terms | |
| # under which the code may be used. | |
| # ------------------------------------------------------------------------------ | |
| name: CI | |
| # This workflow is used for validating code quality on growss PRs. | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| permissions: read-all | |
| jobs: | |
| validate: | |
| name: QC | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| env: | |
| UV_CACHE_DIR: /tmp/.uv-cache | |
| UV_PYTHON: "3.14" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ env.UV_PYTHON }} | |
| enable-cache: true | |
| - name: Restore uv cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.UV_CACHE_DIR }} | |
| key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| uv-${{ runner.os }} | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: YAML Lint | |
| run: uv run yamllint -s . | |
| - name: Python Lint | |
| if: always() | |
| run: uv run ruff check --respect-gitignore . | |
| - name: Python Format Check | |
| if: always() | |
| run: uv run ruff format --check --diff -s --respect-gitignore . | |
| - name: Shell Check | |
| if: always() | |
| shell: bash | |
| run: | | |
| mapfile -d '' potential_files < <( | |
| find . -type f \( -name "*.*sh" -o ! -name "*.*" \) \ | |
| -not -path "*.git/*" -not -path "*.venv/*" -print0 | |
| ) | |
| if [ ${#potential_files[@]} -eq 0 ]; then | |
| echo "No shell scripts to check." | |
| exit 0 | |
| fi | |
| printf "%s\0" "${potential_files[@]}" \ | |
| | xargs -0 file | grep "shell script" | cut -d: -f1 \ | |
| | xargs -r uv run shellcheck -S warning \ | |
| && echo "All checks passed!" | |
| continue-on-error: true | |
| - name: Minimize uv cache | |
| run: uv cache prune --ci |