Skip to content

Commit

Permalink
Update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sandorkertesz committed May 3, 2024
1 parent fecbc15 commit 5270814
Show file tree
Hide file tree
Showing 45 changed files with 538 additions and 564 deletions.
12 changes: 6 additions & 6 deletions .github/ci-hpc-config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
build:
python: '3.10'
modules:
- ninja
- ninja
dependencies:
- ecmwf/ecbuild@develop
- ecmwf/eccodes@develop
- ecmwf/ecbuild@develop
- ecmwf/eccodes@develop
python_dependencies:
- ecmwf/eccodes-python@develop
- ecmwf/eccodes-python@develop
env:
- ECCODES_SAMPLES_PATH=$ECCODES_DIR/share/eccodes/samples
- ECCODES_DEFINITION_PATH=$ECCODES_DIR/share/eccodes/definitions
- ECCODES_SAMPLES_PATH=$ECCODES_DIR/share/eccodes/samples
- ECCODES_DEFINITION_PATH=$ECCODES_DIR/share/eccodes/definitions
parallel: 64
requirements: tests/downstream-ci-requirements.txt
11 changes: 11 additions & 0 deletions .github/workflows/cd-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: cd

on:
push:
tags:
- '**'

jobs:
pypi:
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
secrets: inherit
59 changes: 12 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: ci

on:
# Trigger the workflow on push to master or develop, except tag creation
push:
branches:
- 'master'
- 'develop'
- 'main'
- 'develop'
tags-ignore:
- '**'
- '**'

# Trigger the workflow on pull request
pull_request: ~
pull_request:

# Trigger the workflow manually
workflow_dispatch: ~
workflow_dispatch:

# Trigger after public PR approved for CI
pull_request_target:
types: [labeled]

jobs:
# Run CI including downstream packages on self-hosted runners
downstream-ci:
Expand All @@ -29,25 +29,8 @@ jobs:
pdbufr: ecmwf/pdbufr@${{ github.event.pull_request.head.sha || github.sha }}
codecov_upload: true
secrets: inherit

# # Run CI of private downstream packages on self-hosted runners
# private-downstream-ci:
# name: private-downstream-ci
# needs: [downstream-ci]
# if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
# runs-on: ubuntu-latest
# permissions:
# pull-requests: write
# steps:
# - name: Dispatch private downstream CI
# uses: ecmwf-actions/dispatch-private-downstream-ci@v1
# with:
# token: ${{ secrets.GH_REPO_READ_TOKEN }}
# owner: ecmwf-actions
# repository: private-downstream-ci
# event_type: downstream-ci
# payload: '{"metkit": "ecmwf/metkit@${{ github.event.pull_request.head.sha || github.sha }}"}'



# Build downstream packages on HPC
downstream-ci-hpc:
name: downstream-ci-hpc
Expand All @@ -56,21 +39,3 @@ jobs:
with:
pdbufr: ecmwf/pdbufr@${{ github.event.pull_request.head.sha || github.sha }}
secrets: inherit

# # Run CI of private downstream packages on HPC
# private-downstream-ci-hpc:
# name: private-downstream-ci-hpc
# needs: [downstream-ci-hpc]
# if: (success() || failure()) && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
# runs-on: ubuntu-latest
# permissions:
# pull-requests: write
# steps:
# - name: Dispatch private downstream CI
# uses: ecmwf-actions/dispatch-private-downstream-ci@v1
# with:
# token: ${{ secrets.GH_REPO_READ_TOKEN }}
# owner: ecmwf-actions
# repository: private-downstream-ci
# event_type: downstream-ci-hpc
# payload: '{"metkit": "ecmwf/metkit@${{ github.event.pull_request.head.sha || github.sha }}"}'
4 changes: 2 additions & 2 deletions .github/workflows/label-public-pr-yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Manage labels of pull requests that originate from forks
name: label-public-pr

on:
pull_request_target:
types: [opened, synchronize]

jobs:
label:
uses: ecmwf-actions/reusable-workflows/.github/workflows/label-pr.yml@v2
207 changes: 207 additions & 0 deletions .github/workflows/legacy-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
name: legacy-ci

on:
push:
branches:
- main
- develop
tags:
- "*"
pull_request:
branches:
- main
- develop
pull_request_target:
types: [labeled]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
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]


documentation:
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}

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: environment.yml
environment-name: DEVELOP
channels: conda-forge
cache-env: true
cache-env-key: ubuntu-latest-3.10
extra-specs: |
python=3.10
- name: Install package
run: |
python -m pip install --no-deps -e .
- name: Build documentation
run: |
make docs-build
# on: push

# jobs:
# unit-tests:
# runs-on: ${{ matrix.os }}-latest
# strategy:
# max-parallel: 5
# matrix:
# os: [ubuntu]
# python: ["3.7", "3.8", "3.9", "3.10"]
# extras: ['']
# include:
# - os: macos
# python: "3.8"
# - os: ubuntu
# python: "3.8"
# extras: -minimal
# # python-eccodes and cffi both fail
# # - os: windows
# # python: 3.8

# steps:
# - uses: actions/checkout@v2
# - uses: mamba-org/setup-micromamba@v1
# with:
# micromamba-version: '1.4.3-0'
# environment-name: ${{ matrix.os }}-${{ matrix.python }}${{ matrix.extras }}
# environment-file: tests/environment-${{ matrix.os }}-${{ matrix.python }}${{ matrix.extras }}.yml
# create-args: python=${{ matrix.python }}
# - name: Test with pytest
# shell: bash -l {0}
# run: |
# micromamba install pytest pytest-cov tomli
# pip install --no-deps -e .
# pytest -v --cov=. --cov-report=xml -k 'not test_notebooks' .
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
# - name: Install test tools for notebooks
# shell: bash -l {0}
# run: |
# micromamba install pytest nbformat nbconvert ipykernel
# pytest -v -k 'test_notebooks' .

# docs:
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v2
# - uses: mamba-org/setup-micromamba@v1
# with:
# micromamba-version: '1.4.3-0'
# environment-name: ubuntu-3.8
# environment-file: tests/environment-ubuntu-3.8.yml
# create-args: python=${{ matrix.python }}
# - name: Build documentation with Sphinx
# shell: bash -l {0}
# run: |
# micromamba install sphinx
# micromamba install sphinx_rtd_theme -c conda-forge
# micromamba install ipykernel
# micromamba install pandoc
# micromamba install nbsphinx
# micromamba install ipython_genutils
# micromamba install jinja2=3.0.3
# pip install --no-deps -e .
# python setup.py build_sphinx
# # - name: Test README with pytest
# # shell: bash -l {0}
# # run: |
# # conda install pytest pytest-cov tomli
# # pip install --no-deps -e .
# # pytest -v --cov=. --cov-report=xml README.rst

# code-quality:
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v2
# - uses: mamba-org/setup-micromamba@v1
# with:
# micromamba-version: '1.4.3-0'
# environment-name: ubuntu-3.8
# environment-file: tests/environment-ubuntu-3.8.yml
# create-args: python=3.8
# - name: Lint with flake8
# shell: bash -l {0}
# run: |
# micromamba install flake8
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Type check with mypy
# shell: bash -l {0}
# run: |
# micromamba install mypy pytest
# mypy --strict .

# code-style:
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v2
# - uses: mamba-org/setup-micromamba@v1
# with:
# micromamba-version: '1.4.3-0'
# environment-name: ubuntu-3.8
# environment-file: tests/environment-ubuntu-3.8.yml
# create-args: python=3.8
# - name: Check code style with black
# shell: bash -l {0}
# run: |
# micromamba install black
# black --check .
# - name: Check code style with isort
# shell: bash -l {0}
# run: |
# micromamba install isort
# isort --check .

# deploy:
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v2
# - uses: mamba-org/setup-micromamba@v1
# with:
# micromamba-version: '1.4.3-0'
# environment-name: ubuntu-3.8
# environment-file: tests/environment-ubuntu-3.8.yml
# create-args: python=3.8
# - name: Check MANIFEST.in
# shell: bash -l {0}
# run: |
# micromamba install -c conda-forge check-manifest
# check-manifest .
# - name: Build distributions
# shell: bash -l {0}
# run: |
# micromamba install pip setuptools wheel
# python setup.py sdist bdist_wheel
Loading

0 comments on commit 5270814

Please sign in to comment.