-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
58 changed files
with
4,244 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
name: 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] | ||
|
||
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 -e . | ||
- name: Run tests | ||
run: | | ||
make unit-tests | ||
type-check: | ||
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} | ||
|
||
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: Run code quality checks | ||
run: | | ||
echo type-check not used | ||
documentation: | ||
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} | ||
|
||
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 | ||
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 -e . | ||
- name: Run tests | ||
run: | | ||
make unit-tests | ||
distribution: | ||
needs: [integration-tests, type-check, 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 }} | ||
|
||
notify: | ||
if: always() && ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} | ||
needs: | ||
- pre-commit | ||
- unit-tests | ||
- type-check | ||
- documentation | ||
- integration-tests | ||
- distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger Teams notification | ||
uses: ecmwf-actions/notify-teams@v1 | ||
with: | ||
incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} | ||
needs_context: ${{ toJSON(needs) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Notify new issue | ||
|
||
on: | ||
issues: | ||
types: | ||
- "opened" | ||
|
||
jobs: | ||
notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify new issue | ||
uses: ecmwf-actions/notify-teams-issue@v1 | ||
with: | ||
incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Notify new PR | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- "opened" | ||
|
||
jobs: | ||
notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Notify new PR | ||
uses: ecmwf-actions/notify-teams-pr@v1 | ||
with: | ||
incoming_webhook: ${{ secrets.MS_TEAMS_INCOMING_WEBHOOK }} |
Oops, something went wrong.