Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .ci/manifest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# An island for now: eccodes, eckit, metkit, mir, odc, fdb, gribjump, cfgrib, and pdbufr come from PyPI.
[[deps]]
build-type-input = "python-build-type"
compiler-inputs = []
package = "multiurl"
python-version-input = "python-version"
ref = "develop"
repo = "ecmwf/multiurl"

[[deps]]
build-type-input = "python-build-type"
compiler-inputs = []
package = "earthkit-utils"
python-version-input = "python-version"
ref = "develop"
repo = "ecmwf/earthkit-utils"

[[deps]]
build-type-input = "python-build-type"
compiler-inputs = []
package = "earthkit-geo"
python-version-input = "python-version"
ref = "develop"
repo = "ecmwf/earthkit-geo"

[matrix.test]
triggers = ["upstream-change", "rebuild-request"]

[matrix.test.defaults]
container = "eccr.ecmwf.int/public-ci-images/ubuntu24.04-base:latest"
extras = "all,test,ci"
job-script = "./.ci/test.sh.j2"
platform = "ubuntu-24.04"
python-build-type = "Release"
runs-on = "ubuntu-latest"

[[matrix.test.include]]
python-version = "3.12"

[[matrix.test.include]]
python-version = "3.13"

[package]
allow-stale-deps = true
ci-pre-commit = false
compiler-inputs = []
full-history = true
name = "earthkit-data"
repo = "ecmwf/earthkit-data"
visibility = "public"

[[trigger-downstream]]
ref = "develop"
repo = "ecmwf/earthkit-transforms"

[[trigger-downstream]]
ref = "main"
repo = "ecmwf/earthkit-workflows"

[[trigger-downstream]]
ref = "develop"
repo = "ecmwf/earthkit-hydro"

[[trigger-downstream]]
ref = "develop"
repo = "ecmwf/earthkit-meteo"

[[trigger-downstream]]
ref = "develop"
repo = "ecmwf/earthkit-plots"

[[trigger-downstream]]
ref = "develop"
repo = "ecmwf/earthkit"
8 changes: 8 additions & 0 deletions .ci/test.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "ci-infrastructure/python-runner.sh.j2" %}
{% block test %}
cd "$CI_SOURCE_DIR"
python -m pytest -vv -m 'not notebook and not no_cache_init' -k 'not netcdf' --cov=. --cov-report=xml
python -m pytest -v -m 'notebook'
python -m pytest --forked -vv -m 'no_cache_init' -k 'not netcdf'
python -m coverage report
{% endblock %}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# BEGIN org baseline: maintainers own .github/ and CODEOWNERS (ci-infrastructure scripts/apply-codeowners.sh)
/.github/ @JamesVarndell @sandorkertesz
/.ci/ @JamesVarndell @sandorkertesz
/CODEOWNERS @JamesVarndell @sandorkertesz
/docs/CODEOWNERS @JamesVarndell @sandorkertesz
# END org baseline
167 changes: 136 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,141 @@
name: ci
# GENERATED FILE - DO NOT EDIT.
# Regenerate via the ci-infrastructure-generate CLI.
# Source of truth: each repo's .ci/manifest.toml.
name: CI

on:
# Trigger the workflow on push to master or develop, except tag creation
push:
branches:
- "main"
- "develop"
tags-ignore:
- "**"
paths-ignore:
- "docs/**"
- "README.md"
# Trigger the workflow on pull request
branches: [develop, master, main]
pull_request:
paths-ignore:
- "docs/**"
- "README.md"
# Trigger the workflow manually
types: [opened, reopened, synchronize]
workflow_dispatch:
schedule:
- cron: "13 4 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

env:
ARTIFACT_POLL_INTERVAL: ${{ vars.ARTIFACT_POLL_INTERVAL || '60' }}
ARTIFACT_WAIT_TIMEOUT: ${{ vars.ARTIFACT_WAIT_TIMEOUT || '1800' }}
ARTIFACT_S3_ENDPOINT: ${{ secrets.ARTIFACT_S3_ENDPOINT }}
ARTIFACT_S3_BUCKET: ${{ secrets.ARTIFACT_S3_BUCKET }}
SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:
# Run CI including downstream packages on self-hosted runners
downstream-ci:
name: downstream-ci
uses: ecmwf/downstream-ci/.github/workflows/downstream-ci.yml@main
with:
earthkit-data: ecmwf/earthkit-data@${{ github.event.pull_request.head.sha || github.sha }}
codecov_upload: true
python_qa: false
secrets: inherit
# Build downstream packages on HPC
downstream-ci-hpc:
name: downstream-ci-hpc
uses: ecmwf/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
with:
earthkit-data: ecmwf/earthkit-data@${{ github.event.pull_request.head.sha || github.sha }}
secrets: inherit
ci-approval:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: ecmwf/ci-infrastructure/actions/require-ci-approval@main

resolve:
needs: ci-approval
runs-on: ubuntu-latest
outputs:
matrices: ${{ steps.r.outputs.json }}
dispatch-plans: ${{ steps.r.outputs.dispatch-plans }}
steps:
- id: mint
uses: ecmwf/ci-infrastructure/actions/mint-token@main
with:
client-id: ${{ vars.CI_READER_APP_CLIENT_ID }}
private-key: ${{ secrets.CI_READER_APP_PRIVATE_KEY }}
repositories: earthkit-data,earthkit-geo,earthkit-utils,multiurl
permissions: contents:read actions:read
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- id: r
uses: ecmwf/ci-infrastructure/actions/resolve-deps@main
with:
matrix: test
token: ${{ steps.mint.outputs.token }}
rebuild-missing: 'true'
- name: Wait for the deps of test
if: steps.r.outputs.dispatch-plans == '[]'
uses: ecmwf/ci-infrastructure/actions/wait-for-deps@main
with:
matrix: ${{ steps.r.outputs.json }}
kinds: test
token: ${{ steps.mint.outputs.token }}
name: resolve + wait-build

rebuild-producers:
needs: [ci-approval, resolve]
runs-on: ubuntu-latest
steps:
- if: needs.resolve.outputs.dispatch-plans != '' && needs.resolve.outputs.dispatch-plans != '[]'
uses: ecmwf/ci-infrastructure/actions/dispatch-producers@main
with:
dispatch-plans: ${{ needs.resolve.outputs.dispatch-plans }}
repositories: earthkit-data,earthkit-geo,earthkit-utils,multiurl
client-id: ${{ vars.CI_DISPATCHER_APP_CLIENT_ID }}
app-private-key: ${{ secrets.CI_DISPATCHER_APP_PRIVATE_KEY }}

test:
needs: [ci-approval, resolve, rebuild-producers]
name: test (${{ matrix._resolved['job-name'] }})
runs-on: ${{ matrix['runs-on'] }}
container:
image: ${{ matrix.container || '' }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.matrices).test }}
steps:
- name: Announce image
uses: ecmwf/ci-infrastructure/actions/announce-image@main
- id: mint
uses: ecmwf/ci-infrastructure/actions/mint-token@main
with:
client-id: ${{ vars.CI_READER_APP_CLIENT_ID }}
private-key: ${{ secrets.CI_READER_APP_PRIVATE_KEY }}
repositories: earthkit-data,earthkit-geo,earthkit-utils,multiurl
permissions: contents:read actions:read
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- name: Fetch resolved deps
id: deps
uses: ecmwf/ci-infrastructure/actions/fetch-deps@main
with:
deps-json: ${{ toJSON(matrix._resolved.deps) }}
token: ${{ steps.mint.outputs.token }}
- name: Print dependency table
uses: ecmwf/ci-infrastructure/actions/print-dep-table@main
with:
resolved: ${{ toJSON(matrix._resolved) }}
- name: Build
id: build
uses: ecmwf/ci-infrastructure/actions/run-job-script@main
with:
job-script: ${{ matrix.job-script }}
matrix-leg: ${{ toJSON(matrix) }}
package: earthkit-data
cmake-prefix-path: ${{ steps.deps.outputs.cmake-prefix-path }}
- name: Publish
uses: ecmwf/ci-infrastructure/actions/publish-artifact@main
with:
install-path: ${{ steps.build.outputs.install-path }}
artifact-name: ${{ matrix._resolved['own-artifact-name'] }}

ci-result:
name: collect results
if: always()
needs: [ci-approval, resolve, test]
runs-on: ubuntu-latest
permissions:
statuses: write
steps:
- uses: ecmwf/ci-infrastructure/actions/ci-result@main
with:
needs: ${{ toJSON(needs) }}
8 changes: 0 additions & 8 deletions .github/workflows/label-public-pr.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/old_CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: old CI

on:
# Trigger the workflow after the new CI succeeded on a push
workflow_run:
workflows: [CI]
types: [completed]
branches:
- "main"
- "develop"

# Trigger the workflow manually
workflow_dispatch:

jobs:
# Run CI including downstream packages on self-hosted runners
downstream-ci:
name: downstream-ci
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success') }}
uses: ecmwf/downstream-ci/.github/workflows/downstream-ci.yml@main
with:
ci_group: only-self
earthkit-data: ecmwf/earthkit-data@${{ github.event.workflow_run.head_sha || github.sha }}
codecov_upload: true
python_qa: false
secrets: inherit

# Build downstream packages on HPC
downstream-ci-hpc:
name: downstream-ci-hpc
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success') }}
uses: ecmwf/downstream-ci/.github/workflows/downstream-ci-hpc.yml@main
with:
ci_group: only-self
earthkit-data: ecmwf/earthkit-data@${{ github.event.workflow_run.head_sha || github.sha }}
secrets: inherit
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ repos:
hooks:
- id: pretty-format-yaml
args: [--autofix, --preserve-quotes]
# Written by the ci-infrastructure regenerator, which would undo the formatting.
exclude: ^\.github/workflows/(ci|ci-fork|cross-repo-trigger.*|trigger-downstream.*|pr-label-.*|pr-sync-branch|retry-nightly)\.yml$
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/sphinx-contrib/sphinx-lint
Expand Down
Loading