diff --git a/.github/ci-approval-allowlist.yml b/.github/ci-approval-allowlist.yml new file mode 100644 index 000000000..33d6b31ea --- /dev/null +++ b/.github/ci-approval-allowlist.yml @@ -0,0 +1,8 @@ +--- +exempt: + - workflow: contributor-declaration.yml + - workflow: label-public-pr.yml + - workflow: notify-pull-request.yml + - workflow: pr-label-downstream-ci.yml + - workflow: old_CI.yml + reason: "legacy, retiring; gates downstream-ci with an if: rather than needs:" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b355af0c..9f601d472 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: branches: [develop, master] pull_request: - types: [opened, reopened, synchronize, labeled, unlabeled] + types: [opened, reopened, synchronize, labeled] workflow_dispatch: concurrency: @@ -30,8 +30,17 @@ jobs: steps: - uses: ecmwf/ci-infrastructure/actions/require-ci-approval@main - resolve: + pre-commit: needs: ci-approval + runs-on: ubuntu-slim + env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' + steps: + - uses: actions/checkout@v6 + - uses: ecmwf/ci-infrastructure/actions/pre-commit@main + + resolve: + needs: [ci-approval, pre-commit] runs-on: arc-runner-normal container: image: eccr.ecmwf.int/public-ci-images/ubuntu24.04-base:latest @@ -47,9 +56,7 @@ jobs: client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} owner: ${{ github.repository_owner }} - - uses: actions/checkout@v6 - with: - ref: ${{ github.event.pull_request.number && format('refs/pull/{0}/merge', github.event.pull_request.number) || '' }} + - uses: ecmwf/ci-infrastructure/actions/checkout-under-test@main - id: r uses: ecmwf/ci-infrastructure/actions/resolve-deps@main with: @@ -61,7 +68,7 @@ jobs: build: needs: [ci-approval, resolve] - name: build+test (${{ matrix.platform }}, ${{ matrix.cxx-compiler }}) + name: build+test (${{ matrix._resolved['job-name'] }}) runs-on: ${{ matrix['runs-on'] }} container: image: ${{ matrix.container || '' }} @@ -77,9 +84,7 @@ jobs: client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} owner: ${{ github.repository_owner }} - - uses: actions/checkout@v6 - with: - ref: ${{ github.event.pull_request.number && format('refs/pull/{0}/merge', github.event.pull_request.number) || '' }} + - uses: ecmwf/ci-infrastructure/actions/checkout-under-test@main - name: Fetch resolved deps id: deps @@ -96,11 +101,6 @@ jobs: cxx-compiler: ${{ matrix.cxx-compiler }} build-type: ${{ matrix.build-type }} - - name: Print dependency table - uses: ecmwf/ci-infrastructure/actions/print-dep-table@main - with: - resolved-json: ${{ toJSON(matrix._resolved) }} - # Invocation comes from .ci/manifest.toml's [matrix.build], the same place # the generated cross-repo-trigger.yml renders its Test step from. Spelling # it out again here is how the two lanes drift apart. @@ -114,9 +114,15 @@ jobs: install-path: ${{ steps.build.outputs.install-path }} artifact-name: ${{ matrix._resolved.own-artifact-name }} + - name: Print dependency table + if: always() + uses: ecmwf/ci-infrastructure/actions/print-dep-table@main + with: + resolved: ${{ toJSON(matrix._resolved) }} + build-hpc: needs: [ci-approval, resolve] - name: build-hpc (${{ matrix.platform }}) + name: build-hpc (${{ matrix._resolved['job-name'] }}) runs-on: ${{ matrix['runs-on'] }} container: image: ${{ matrix.container }} @@ -135,9 +141,7 @@ jobs: client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} owner: ${{ github.repository_owner }} - - uses: actions/checkout@v6 - with: - ref: ${{ github.event.pull_request.number && format('refs/pull/{0}/merge', github.event.pull_request.number) || '' }} + - uses: ecmwf/ci-infrastructure/actions/checkout-under-test@main - name: Fetch resolved deps id: deps @@ -150,6 +154,7 @@ jobs: install-python-deps: 'false' - name: Build eckit on HPC + id: build uses: ecmwf/ci-infrastructure/actions/build-on-hpc@main with: site: ${{ matrix.site }} @@ -161,3 +166,10 @@ jobs: work-dir: ${{ vars.HPC_CI_WORK_DIR }} remote-work-dir: ${{ vars.HPC_CI_REMOTE_WORK_DIR }} troika-user: ${{ secrets.HPC_CI_SSH_USER }} + + - name: Print dependency table + if: always() + uses: ecmwf/ci-infrastructure/actions/print-dep-table@main + with: + resolved: ${{ toJSON(matrix._resolved) }} + own-source: ${{ steps.build.outputs.cache-hit == 'true' && 'artifact' || 'built' }} diff --git a/.github/workflows/contributor-declaration.yml b/.github/workflows/contributor-declaration.yml index 7028030a9..aebb7654b 100644 --- a/.github/workflows/contributor-declaration.yml +++ b/.github/workflows/contributor-declaration.yml @@ -1,11 +1,15 @@ name: Contributor Declaration on: - # pull_request_target runs the BASE branch's copy of this file, so a pull - # request cannot edit the gate that judges it. Safe here because nothing from - # the pull request is ever checked out or executed and no write token is used. - pull_request_target: - types: [opened, edited, reopened, synchronize] + # Parked: run it by hand only, until the declaration check comes back. To + # restore, put back the trigger below -- pull_request_target runs the BASE + # branch's copy of this file, so a pull request cannot edit the gate that + # judges it, and it is safe here because nothing from the pull request is ever + # checked out or executed and no write token is used. + # + # pull_request_target: + # types: [opened, edited, reopened, synchronize] + workflow_dispatch: permissions: contents: read diff --git a/.github/workflows/cross-repo-trigger-hpc.yml b/.github/workflows/cross-repo-trigger-hpc.yml index cf967a14b..86a41aff9 100644 --- a/.github/workflows/cross-repo-trigger-hpc.yml +++ b/.github/workflows/cross-repo-trigger-hpc.yml @@ -115,7 +115,7 @@ jobs: needs: - resolve if: contains(fromJSON(inputs.from-jobs), 'ecbuild/build-hpc') || contains(fromJSON(inputs.from-jobs), 'stack-deps/build-hpc') || inputs.rebuild-request - name: eckit/build-hpc (${{ matrix.platform }}, ${{ matrix['cxx-compiler'] }}) + name: eckit/build-hpc (${{ matrix._resolved['job-name'] }}) runs-on: ${{ matrix['runs-on'] }} container: image: ${{ matrix.container || '' }} @@ -139,7 +139,7 @@ jobs: token: ${{ steps.mint.outputs.token }} head-repo: ${{ inputs.from-repo }} head-sha: ${{ inputs.from-sha }} - name: eckit/build-hpc (${{ matrix.platform }}, ${{ matrix['cxx-compiler'] }}) + name: eckit/build-hpc (${{ matrix._resolved['job-name'] }}) details-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} phase: start - name: Announce image @@ -203,7 +203,7 @@ jobs: token: ${{ steps.mint.outputs.token }} head-repo: ${{ inputs.from-repo }} head-sha: ${{ inputs.from-sha }} - name: eckit/build-hpc (${{ matrix.platform }}, ${{ matrix['cxx-compiler'] }}) + name: eckit/build-hpc (${{ matrix._resolved['job-name'] }}) details-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} phase: finish conclusion: ${{ job.status }} diff --git a/.github/workflows/cross-repo-trigger.yml b/.github/workflows/cross-repo-trigger.yml index ee0e8be7b..1c756e6ac 100644 --- a/.github/workflows/cross-repo-trigger.yml +++ b/.github/workflows/cross-repo-trigger.yml @@ -115,7 +115,7 @@ jobs: needs: - resolve if: contains(fromJSON(inputs.from-jobs), 'ecbuild/build') || contains(fromJSON(inputs.from-jobs), 'stack-deps/build') || inputs.rebuild-request - name: eckit/build (${{ matrix.platform }}, ${{ matrix['cxx-compiler'] }}) + name: eckit/build (${{ matrix._resolved['job-name'] }}) runs-on: ${{ matrix['runs-on'] }} container: image: ${{ matrix.container || '' }} @@ -136,7 +136,7 @@ jobs: token: ${{ steps.mint.outputs.token }} head-repo: ${{ inputs.from-repo }} head-sha: ${{ inputs.from-sha }} - name: eckit/build (${{ matrix.platform }}, ${{ matrix['cxx-compiler'] }}) + name: eckit/build (${{ matrix._resolved['job-name'] }}) details-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} phase: start - name: Announce image @@ -205,7 +205,7 @@ jobs: token: ${{ steps.mint.outputs.token }} head-repo: ${{ inputs.from-repo }} head-sha: ${{ inputs.from-sha }} - name: eckit/build (${{ matrix.platform }}, ${{ matrix['cxx-compiler'] }}) + name: eckit/build (${{ matrix._resolved['job-name'] }}) details-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} phase: finish conclusion: ${{ job.status }} diff --git a/.github/workflows/trigger-downstream-hpc.yml b/.github/workflows/trigger-downstream-hpc.yml index 83f96b7ea..80a978909 100644 --- a/.github/workflows/trigger-downstream-hpc.yml +++ b/.github/workflows/trigger-downstream-hpc.yml @@ -12,26 +12,37 @@ concurrency: group: trigger-downstream-hpc-${{ github.event.workflow_run.head_sha }} cancel-in-progress: true jobs: + context: + runs-on: ubuntu-slim + permissions: + actions: read + outputs: + head-sha: ${{ steps.ctx.outputs.head-sha }} + head-branch: ${{ steps.ctx.outputs.head-branch }} + ci-conclusion: ${{ steps.ctx.outputs.ci-conclusion }} + ci-url: ${{ steps.ctx.outputs.ci-url }} + ci-summary: ${{ steps.ctx.outputs.ci-summary }} + steps: + - name: Resolve the commit under test + id: ctx + uses: ecmwf/ci-infrastructure/actions/resolve-dispatch-context@main label-gate: runs-on: ubuntu-slim + permissions: + pull-requests: read outputs: run: ${{ steps.gate.outputs.run }} steps: - - id: mint - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} - private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - name: Check the downstream-CI label id: gate uses: ecmwf/ci-infrastructure/actions/check-pr-label@main with: label: run-downstream-CI - sha: ${{ github.event.workflow_run.head_sha }} - token: ${{ steps.mint.outputs.token }} + sha: ${{ needs.context.outputs.head-sha }} + needs: + - context validate: - if: ${{ (github.event.workflow_run.conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + if: ${{ (needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-slim steps: - id: mint @@ -42,88 +53,82 @@ jobs: owner: ${{ github.repository_owner }} - uses: actions/checkout@v6 with: - ref: ${{ github.event.workflow_run.head_sha }} + ref: ${{ needs.context.outputs.head-sha }} token: ${{ steps.mint.outputs.token }} + allow-unsafe-pr-checkout: true - uses: ecmwf/ci-infrastructure/actions/validate-generated-workflows@main with: token: ${{ steps.mint.outputs.token }} needs: + - context - label-gate report-start: - if: ${{ (github.event.workflow_run.conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + if: ${{ (needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-slim + permissions: + statuses: write steps: - - id: mint - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} - private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - name: Post pending downstream status env: - GH_TOKEN: ${{ steps.mint.outputs.token }} + GH_TOKEN: ${{ github.token }} run: | gh api -X POST \ - "/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_sha }}" \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ -f state=pending \ -f context='downstream/hpc' \ -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ -f description='Downstream HPC tests running' needs: + - context - label-gate report-ci-failure: - if: ${{ (github.event.workflow_run.conclusion != 'success') && needs['label-gate'].outputs.run == 'true' }} + if: ${{ (needs.context.outputs.ci-conclusion != 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-slim + permissions: + statuses: write steps: - - id: mint - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} - private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - name: Post downstream failure status env: - GH_TOKEN: ${{ steps.mint.outputs.token }} + GH_TOKEN: ${{ github.token }} run: | gh api -X POST \ - "/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_sha }}" \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ -f state=failure \ -f context='downstream/hpc' \ - -f target_url="${{ github.event.workflow_run.html_url }}" \ - -f description='Upstream CI failed; downstream HPC not run' + -f target_url="${{ needs.context.outputs.ci-url }}" \ + -f description="${{ needs.context.outputs.ci-summary }}; downstream HPC not run" needs: + - context - label-gate eccodes: name: eccodes needs: + - context - label-gate - validate uses: ecmwf/eccodes/.github/workflows/cross-repo-trigger-hpc.yml@develop with: from-repo: ${{ github.repository }} - from-sha: ${{ github.event.workflow_run.head_sha }} + from-sha: ${{ needs.context.outputs.head-sha }} from-jobs: '["eckit/build-hpc"]' - branch: ${{ github.event.workflow_run.head_branch }} + branch: ${{ needs.context.outputs.head-branch }} fallback-ref: develop secrets: inherit if: ${{ needs['label-gate'].outputs.run == 'true' }} report-result: needs: + - context - label-gate - validate - eccodes - if: ${{ (always() && github.event.workflow_run.conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + if: ${{ (always() && needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-slim + permissions: + statuses: write steps: - - id: mint - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} - private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - name: Post final downstream status env: - GH_TOKEN: ${{ steps.mint.outputs.token }} + GH_TOKEN: ${{ github.token }} run: | state=success for r in ${{ needs.validate.result }} ${{ needs.eccodes.result }}; do @@ -132,7 +137,7 @@ jobs: fi done gh api -X POST \ - "/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_sha }}" \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ -f state="$state" \ -f context='downstream/hpc' \ -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ diff --git a/.github/workflows/trigger-downstream.yml b/.github/workflows/trigger-downstream.yml index e0fae54ba..464ee4082 100644 --- a/.github/workflows/trigger-downstream.yml +++ b/.github/workflows/trigger-downstream.yml @@ -12,26 +12,37 @@ concurrency: group: trigger-downstream-runner-${{ github.event.workflow_run.head_sha }} cancel-in-progress: true jobs: + context: + runs-on: ubuntu-slim + permissions: + actions: read + outputs: + head-sha: ${{ steps.ctx.outputs.head-sha }} + head-branch: ${{ steps.ctx.outputs.head-branch }} + ci-conclusion: ${{ steps.ctx.outputs.ci-conclusion }} + ci-url: ${{ steps.ctx.outputs.ci-url }} + ci-summary: ${{ steps.ctx.outputs.ci-summary }} + steps: + - name: Resolve the commit under test + id: ctx + uses: ecmwf/ci-infrastructure/actions/resolve-dispatch-context@main label-gate: runs-on: ubuntu-slim + permissions: + pull-requests: read outputs: run: ${{ steps.gate.outputs.run }} steps: - - id: mint - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} - private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - name: Check the downstream-CI label id: gate uses: ecmwf/ci-infrastructure/actions/check-pr-label@main with: label: run-downstream-CI - sha: ${{ github.event.workflow_run.head_sha }} - token: ${{ steps.mint.outputs.token }} + sha: ${{ needs.context.outputs.head-sha }} + needs: + - context validate: - if: ${{ (github.event.workflow_run.conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + if: ${{ (needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-slim steps: - id: mint @@ -42,88 +53,82 @@ jobs: owner: ${{ github.repository_owner }} - uses: actions/checkout@v6 with: - ref: ${{ github.event.workflow_run.head_sha }} + ref: ${{ needs.context.outputs.head-sha }} token: ${{ steps.mint.outputs.token }} + allow-unsafe-pr-checkout: true - uses: ecmwf/ci-infrastructure/actions/validate-generated-workflows@main with: token: ${{ steps.mint.outputs.token }} needs: + - context - label-gate report-start: - if: ${{ (github.event.workflow_run.conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + if: ${{ (needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-slim + permissions: + statuses: write steps: - - id: mint - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} - private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - name: Post pending downstream status env: - GH_TOKEN: ${{ steps.mint.outputs.token }} + GH_TOKEN: ${{ github.token }} run: | gh api -X POST \ - "/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_sha }}" \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ -f state=pending \ -f context='downstream/runner' \ -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ -f description='Downstream runner tests running' needs: + - context - label-gate report-ci-failure: - if: ${{ (github.event.workflow_run.conclusion != 'success') && needs['label-gate'].outputs.run == 'true' }} + if: ${{ (needs.context.outputs.ci-conclusion != 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-slim + permissions: + statuses: write steps: - - id: mint - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} - private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - name: Post downstream failure status env: - GH_TOKEN: ${{ steps.mint.outputs.token }} + GH_TOKEN: ${{ github.token }} run: | gh api -X POST \ - "/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_sha }}" \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ -f state=failure \ -f context='downstream/runner' \ - -f target_url="${{ github.event.workflow_run.html_url }}" \ - -f description='Upstream CI failed; downstream runner not run' + -f target_url="${{ needs.context.outputs.ci-url }}" \ + -f description="${{ needs.context.outputs.ci-summary }}; downstream runner not run" needs: + - context - label-gate eccodes: name: eccodes needs: + - context - label-gate - validate uses: ecmwf/eccodes/.github/workflows/cross-repo-trigger.yml@develop with: from-repo: ${{ github.repository }} - from-sha: ${{ github.event.workflow_run.head_sha }} + from-sha: ${{ needs.context.outputs.head-sha }} from-jobs: '["eckit/build"]' - branch: ${{ github.event.workflow_run.head_branch }} + branch: ${{ needs.context.outputs.head-branch }} fallback-ref: develop secrets: inherit if: ${{ needs['label-gate'].outputs.run == 'true' }} report-result: needs: + - context - label-gate - validate - eccodes - if: ${{ (always() && github.event.workflow_run.conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + if: ${{ (always() && needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-slim + permissions: + statuses: write steps: - - id: mint - uses: actions/create-github-app-token@v3 - with: - client-id: ${{ secrets.CI_PERMISSIONS_APP_CLIENT_ID }} - private-key: ${{ secrets.CI_PERMISSIONS_APP_PRIVATE_KEY }} - owner: ${{ github.repository_owner }} - name: Post final downstream status env: - GH_TOKEN: ${{ steps.mint.outputs.token }} + GH_TOKEN: ${{ github.token }} run: | state=success for r in ${{ needs.validate.result }} ${{ needs.eccodes.result }}; do @@ -132,7 +137,7 @@ jobs: fi done gh api -X POST \ - "/repos/${{ github.repository }}/statuses/${{ github.event.workflow_run.head_sha }}" \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ -f state="$state" \ -f context='downstream/runner' \ -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 73dfd914e..134ad45ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,8 +4,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - id: mixed-line-ending args: [--fix=lf] - id: check-merge-conflict @@ -13,25 +11,6 @@ repos: args: [--autofix] types: [json] exclude: '\.geojson$' - - repo: https://github.com/PyCQA/isort - rev: 6.0.1 - hooks: - - id: isort - types_or: [python, cython] - args: [--line-length=110, --force-single-line-imports, --profile=black] - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.9.8 - hooks: - - id: ruff - types: [python] - exclude: '_\.py$' - args: [--line-length=110, --fix, --exit-non-zero-on-fix, --preview] - - repo: https://github.com/adrienverge/yamllint.git - rev: v1.29.0 - hooks: - - id: yamllint - args: [--strict, -d, '{extends: default, rules: {line-length: disable}}'] - types: [yaml] - repo: https://github.com/MarcoGorelli/cython-lint rev: v0.16.6 hooks: @@ -45,3 +24,38 @@ repos: - id: clang-format types_or: [c, c++] exclude: 'src/_eckit/_.*\.(h|cpp)' + + - repo: https://github.com/ecmwf/ci-infrastructure + rev: dac4b18ffe60c317fbab05246e851b6971f7eabf + hooks: + - id: check-ci-approval + + # Off until the tree is cleaned up; the counts are what each would flag today. + # + # - repo: https://github.com/pre-commit/pre-commit-hooks + # rev: v5.0.0 + # hooks: + # - id: trailing-whitespace # 6 files + # - id: end-of-file-fixer # 10 files + # + # - repo: https://github.com/PyCQA/isort + # rev: 6.0.1 + # hooks: + # - id: isort # 4 files + # types_or: [python, cython] + # args: [--line-length=110, --force-single-line-imports, --profile=black] + # + # - repo: https://github.com/astral-sh/ruff-pre-commit + # rev: v0.9.8 + # hooks: + # - id: ruff # 2 errors, src/sandbox/server.py + # types: [python] + # exclude: '_\.py$' + # args: [--line-length=110, --fix, --exit-non-zero-on-fix, --preview] + # + # - repo: https://github.com/adrienverge/yamllint.git + # rev: v1.29.0 + # hooks: + # - id: yamllint # 44 files + # args: [--strict, -d, '{extends: default, rules: {line-length: disable}}'] + # types: [yaml]