Skip to content

Commit

Permalink
Update pre-commit-config
Browse files Browse the repository at this point in the history
  • Loading branch information
sandorkertesz committed Oct 11, 2024
1 parent f091f6e commit 18aa5a3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 93 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,25 @@ on:
- '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:

# 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
Expand All @@ -28,7 +37,7 @@ jobs:
with:
earthkit: ecmwf/earthkit@${{ github.event.pull_request.head.sha || github.sha }}
codecov_upload: true
python_qa: true
python_qa: false
secrets: inherit


Expand Down
92 changes: 0 additions & 92 deletions .github/workflows/legacy-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +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/[email protected]

unit-tests:
name: unit-tests (3.10)
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 }}
- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@v14
with:
environment-file: tests/environment-unit-tests.yml
environment-name: DEVELOP
channels: conda-forge
cache-env: true
extra-specs: |
python=3.10
- name: Install package
run: |
python -m pip install . --no-deps
- name: Run tests
run: |
make unit-tests
documentation:
if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -88,58 +51,3 @@ jobs:
- name: Build documentation
run: |
make docs-build
# integration-tests:
# needs: [unit-tests]
# if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
# runs-on: ubuntu-latest
# defaults:
# run:
# shell: bash -l {0}

# strategy:
# matrix:
# include:
# - python-version: "3.10"
# # extra: -minver # This will need to be uncommented and environment-minver.yml updated if we want to publish on conda

# steps:
# - uses: actions/checkout@v3
# with:
# ref: ${{ github.event.pull_request.head.sha || github.ref }}
# - name: Install Conda environment with Micromamba
# uses: mamba-org/provision-with-micromamba@v12
# with:
# environment-file: tests/environment-unit-tests${{ matrix.extra }}.yml
# environment-name: DEVELOP${{ matrix.extra }}
# channels: conda-forge
# cache-env: true
# cache-env-key: ubuntu-latest-${{ matrix.python-version }}${{ matrix.extra }}.
# extra-specs: |
# python=${{matrix.python-version }}
# - name: Install package
# run: |
# python -m pip install --no-deps .
# - name: Run tests
# run: |
# make unit-tests

# distribution:
# needs: [integration-tests, documentation]
# 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 }}
# - name: Build distributions
# run: |
# $CONDA/bin/python -m pip install build
# $CONDA/bin/python -m build
# - name: Publish a Python distribution to PyPI
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/python-pull-request.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 18aa5a3

Please sign in to comment.