A collection of reusable GitHub workflows for ECMWF repositories.
- ci.yml: Continuous Integration workflow for ecbuild/CMake-based projects
- ci-hpc.yml: Continuous Integration workflow for ecbuild/CMake-based projects on HPC
- ci-python.yml: Continuous Integration and Continuous Deployment workflow for Python-based projects
- ci-node.yml: Continuous Integration workflow for NodeJS-based projects
- docs.yml: Workflow for testing Sphinx-based documentation
- qa-precommit-run.yml: Runs the pre-commit hooks on all files server-side as a QA drop-in.
- qa-pytest-pyproject.yml: Runs pytest after a
pyproject.toml
install with a markdown report. - sync.yml: Workflow for syncing a Git repository
- Linux
- macOS
jobs:
# Calls a reusable CI workflow to build & test current repository.
# It will pull in all needed dependencies and produce a code coverage report on success.
# In case the job fails, a message will be posted to a Microsoft Teams channel.
ci:
name: ci
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci.yml@v1
with:
codecov_upload: true
notify_teams: true
build_package_inputs: |
dependencies: |
ecmwf/ecbuild
ecmwf/eckit
dependency_branch: develop
secrets:
incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}
A list of matrix jobs to skip. Job names should be the full form of <compiler>@<platform>
.
Default: ''
Type: string
Dependency cache key to restore from. Note that the key should be platform agnostic, as the <compiler>@<platform>
suffix will be automatically appended. Upon extraction, a file called .env
from the cache root directory will be loaded into the build environment, if it exists.
Default: ''
Type: string
Optional dependency cache path to restore to, falls back to ${{ runner.temp }}/deps
. Will be considered only if deps_cache_key is supplied.
Default: ''
Type: string
Whether to generate and upload code coverage to codecov service for main branches.
Default: false
Type: boolean
Whether to notify about workflow status via Microsoft Teams. Note that you must supply incoming_webhook secret if you switch on this feature.
Default: false
Type: boolean
The source repository name, in case it differs from the current one. Repository names should follow the standard Github owner/name
format.
Default: ${{ github.repository }}
Type: string
The source repository reference, in case it differs from the current one.
Default: ${{ github.ref }}
Type: string
Optional inputs for the build-package action, provided as a YAML object value.
Default: ''
Type: string
Public URL of the Microsoft Teams incoming webhook. To get the value, make sure that channel in Teams has the appropriate connector set up. It will only be used if notify_teams input is switched on.
Example: https://webhook.office.com/webhookb2/...
jobs:
ci-hpc:
name: ci-hpc
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci-hpc.yml@v2
with:
name-prefix: metkit-
build-inputs: |
--package: ecmwf/metkit@develop
--modules: |
ecbuild
ninja
--dependencies: |
ecmwf/eccodes@develop
ecmwf/eckit@develop
--parallel: 64
secrets: inherit\
Job name prefix. Usually the package name. Suitable when building multiple packages within one workflow to easily differentiate between them.
Default: ''
Type: string
Inputs for build-package-hpc
action.
Default: ''
Type: string
Whether to build using development runner which contains latest version of build-package-hpc
.
Default: ''
Type: string
jobs:
# Calls a reusable CI workflow to qa, test & deploy the current repository.
# It will pull in all needed dependencies and produce a code coverage report on success.
# If all checks were successful and a new release tag pushed, the package will be published on PyPI.
# In case the job fails, a message will be posted to a Microsoft Teams channel.
ci:
name: ci
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci-python.yml@v1
with:
codecov_upload: true
notify_teams: true
build_package_inputs: |
dependencies: |
ecmwf/ecbuild
ecmwf/eckit
ecmwf/odc
dependency_branch: develop
self_build: false
secrets:
pypi_username: ${{ secrets.PYPI_USERNAME }}
pypi_password: ${{ secrets.PYPI_PASSWORD }}
incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}
A list of matrix jobs to skip. Job names should be the full form of <compiler>@<platform>
.
Default: ''
Type: string
Whether to generate and upload code coverage to codecov service for main branches.
Default: false
Type: boolean
Whether to notify about workflow status via Microsoft Teams. Note that you must supply incoming_webhook secret if you switch on this feature.
Default: false
Type: boolean
The version of Python binary to use.
Default: '3.9'
Type: ring
The source repository name. Repository names should follow the standard Github owner/name
format.
Default: ${{ github.repository }}
Type: string
The source repository reference.
Default: ${{ github.ref }}
Type: string
Optional inputs for the build-package action, provided as a YAML object value.
Default: ''
Type: string
Username of the PyPI account. The account must have sufficient permissions to deploy the current project.
Example: MyUsername
Password of the PyPI account.
Example: MyPassword
Public URL of the Microsoft Teams incoming webhook. To get the value, make sure that channel in Teams has the appropriate connector set up. It will only be used if notify_teams input is switched on.
Example: https://webhook.office.com/webhookb2/...
jobs:
# Calls a reusable CI NodeJS workflow to qa & test & deploy the current repository.
# It will install dependencies and produce a code coverage report on success.
# In case the job fails, a message will be posted to a Microsoft Teams channel.
ci:
name: ci
uses: ecmwf-actions/reusable-workflows/.github/workflows/ci-node.yml@v1
with:
codecov_upload: true
notify_teams: true
secrets:
incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }}
A list of matrix jobs to skip. Job names should be the form of <platform>
.
Default: ''
Type: string
Whether to generate and upload code coverage to codecov service for main branches.
Default: false
Type: boolean
Whether to notify about workflow status via Microsoft Teams. Note that you must supply incoming_webhook secret if you switch on this feature.
Default: false
Type: boolean
Whether to build from currently checked out repository or not.
Default: true
Type: boolean
Whether to run tests from currently checked out repository or not.
Default: true
Type: boolean
The version of NodeJS interpreter to use.
Default: '16'
Type: string
The source repository name. Repository names should follow the standard Github owner/name
format.
Default: ${{ github.repository }}
Type: string
The source repository reference.
Default: ${{ github.ref }}
Type: string
Public URL of the Microsoft Teams incoming webhook. To get the value, make sure that channel in Teams has the appropriate connector set up. It will only be used if notify_teams input is switched on.
Example: https://webhook.office.com/webhookb2/...
jobs:
# Calls a reusable CI workflow to build & check the documentation in the current repository.
# It will install required system dependencies and test Read the Docs build process.
docs:
name: docs
uses: ecmwf-actions/reusable-workflows/.github/workflows/docs.yml@v1
with:
system_dependencies: doxygen pandoc
Path of the requirements.txt
file which includes all dependencies needed for building of the documentation, relative to the repository root.
Default: docs/requirements.txt
Type: string
Path of the documentation directory, relative to the repository root.
Default: docs
Type: string
Optional list of system dependencies to install via apt
command, separated by spaces. Note that each dependency must be available via standard Ubuntu 20.04 package repositories.
Default: ''
Type: string
The version of Python binary to use.
Default: '3.9'
Type: ring
The source repository name, in case it differs from the current one. Repository names should follow the standard Github owner/name
format.
Default: ${{ github.repository }}
Type: string
The source repository reference, in case it differs from the current one.
Default: ${{ github.ref }}
Type: string
on:
push:
pull_request_target:
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'
Optional, pin to use a specific Python version
Default: '3.x'
Type: string
Example: '3.9'
Optional, a comma-separated string of pre-commit hooks to skip.
Default: ''
Type: string
Example: 'no-commit-to-branch,black'
on:
push:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
checks:
strategy:
matrix:
python-version: ['3.9', '3.10']
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
with:
python-version: ${{ matrix.python-version }}
Optional, the version of Python binary to use.
Default: '3.x'
Type: string
Example: '3.9'
Optional, optional dependencies to install from package to be tested.
Default: 'all,tests'
Type: string
Example: dev,tests,third_dependency_group
Optional, the pytest marks to pass to the -m
command flag.
Expands in pytest -v -m "${{ inputs.skip-tests }}"
to coordinate marked tests.
Default: ''
Type: string
Example: 'no gpu'
Default: false
Type: boolean
Example: true
Default: true
Type: boolean
Example: false
Default: 'pytest'
Type: string
Example: 'poetry run pytest'
# Controls when the workflow will run
on:
# Trigger the workflow on all pushes
push:
branches:
- '**'
tags:
- '**'
# Trigger the workflow when a branch or tag is deleted
delete: ~
jobs:
# Calls a reusable CI workflow to sync the current with a remote repository.
# It will correctly handle addition of any new and removal of existing Git objects.
sync:
name: sync
uses: ecmwf-actions/reusable-workflows/.github/workflows/sync.yml@v1
secrets:
target_repository: ${{ secrets.BITBUCKET_REPOSITORY }}
target_username: ${{ secrets.BITBUCKET_USERNAME }}
target_token: ${{ secrets.BITBUCKET_PAT }}
Optional inputs for the sync-repository action, provided as a YAML object value. Note that some values may be overwritten by provided secrets with same name.
Default: ''
Type: string
The user access token with read access to the source repository, must be URL-encoded.
Default: github.token
Example: ...
Required The name of the target repository.
Example: project-name/repo-name
Required The user login with write access to the target repository, must be URL-encoded.
Example: user
Required The user access token with write access to the target repository, must be URL-encoded.
Example: ...
Manages labels on public pull requests. contributor
label is added when a PR from public fork is opened. Removes label approved-for-ci
when pull request HEAD changes.
on:
# trigger the pull request is opened or pushed to
pull_request_target:
types: [opened, synchronize]
jobs:
label:
uses: ecmwf-actions/reusable-workflows/.github/workflows/pr-label.yml@v2
npm install
npm run lint
This software is licensed under the terms of the Apache License Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
In applying this licence, ECMWF does not waive the privileges and immunities granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.