From af659d1d71a09de28981d3434880e152b74f91f4 Mon Sep 17 00:00:00 2001 From: Sandor Kertesz Date: Mon, 20 Jan 2025 10:01:55 +0000 Subject: [PATCH] Update ci --- .github/workflows/ci.yml | 18 +++++++++++++----- .github/workflows/legacy-ci.yml | 12 ------------ .github/workflows/python-pull-request.yml | 12 ++++++++++++ 3 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/python-pull-request.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a1bbb4..e06f676 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,13 +4,19 @@ on: # Trigger the workflow on push to master or develop, except tag creation push: branches: - - 'main' - - 'develop' + - "main" + - "develop" tags-ignore: - - '**' + - "**" + paths-ignore: + - "docs/**" + - "README.md" # Trigger the workflow on pull request pull_request: + paths-ignore: + - "docs/**" + - "README.md" # Trigger the workflow manually workflow_dispatch: @@ -18,6 +24,9 @@ on: # Trigger after public PR approved for CI pull_request_target: types: [labeled] + paths-ignore: + - "docs/**" + - "README.md" jobs: # Run CI including downstream packages on self-hosted runners @@ -28,10 +37,9 @@ jobs: with: earthkit-regrid: ecmwf/earthkit-regrid@${{ github.event.pull_request.head.sha || github.sha }} codecov_upload: true - python_qa: true + python_qa: false secrets: inherit - # Build downstream packages on HPC downstream-ci-hpc: name: downstream-ci-hpc diff --git a/.github/workflows/legacy-ci.yml b/.github/workflows/legacy-ci.yml index b2eaa2e..77b015a 100644 --- a/.github/workflows/legacy-ci.yml +++ b/.github/workflows/legacy-ci.yml @@ -24,18 +24,6 @@ defaults: shell: bash -l {0} jobs: - pre-commit: - if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha || github.ref }} - - uses: actions/setup-python@v4 - with: - python-version: 3.x - - uses: pre-commit/action@v3.0.0 - documentation: if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} runs-on: ubuntu-latest diff --git a/.github/workflows/python-pull-request.yml b/.github/workflows/python-pull-request.yml new file mode 100644 index 0000000..2c38063 --- /dev/null +++ b/.github/workflows/python-pull-request.yml @@ -0,0 +1,12 @@ +name: Code Quality checks for PRs + +on: + push: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + quality: + uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2 + with: + skip-hooks: "no-commit-to-branch"