-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8e5b39
commit 2c59d0b
Showing
4 changed files
with
147 additions
and
0 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,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,21 @@ | ||
name: "Ensure Conventional Commit in PR title" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,104 @@ | ||
name: Test PR | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: | ||
- develop | ||
schedule: | ||
- cron: "9 2 * * 0" # at 9:02 on sunday | ||
|
||
jobs: | ||
quality: | ||
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-precommit-run.yml@v2 | ||
with: | ||
skip-hooks: "no-commit-to-branch" | ||
|
||
checks: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install basic dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest pytest-md pytest-emoji | ||
- name: Detect changed packages | ||
id: changed-packages | ||
run: | | ||
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }}) | ||
echo "training_changed=$(echo "$CHANGED_FILES" | grep -q '^training/.*\.py$' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT | ||
echo "graphs_changed=$(echo "$CHANGED_FILES" | grep -q '^graphs/.*\.py$' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT | ||
echo "models_changed=$(echo "$CHANGED_FILES" | grep -q '^models/.*\.py$' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT | ||
- name: Install training package | ||
run: | | ||
if [[ ${{ steps.changed-packages.outputs.training_changed }} == 'true' ]]; then | ||
echo "Installing training from local source" | ||
pip install -e ./training[tests] | ||
else | ||
echo "Installing training from PyPI" | ||
pip install anemoi-training[tests] | ||
fi | ||
- name: Install graphs package | ||
run: | | ||
if [[ ${{ steps.changed-packages.outputs.graphs_changed }} == 'true' ]]; then | ||
echo "Installing graphs from local source" | ||
pip install -e ./graphs[tests] | ||
else | ||
echo "Installing graphs from PyPI" | ||
pip install anemoi-graphs[tests] | ||
fi | ||
- name: Install models package | ||
run: | | ||
if [[ ${{ steps.changed-packages.outputs.models_changed }} == 'true' ]]; then | ||
echo "Installing models from local source" | ||
pip install -e ./models[tests] | ||
else | ||
echo "Installing models from PyPI" | ||
pip install anemoi-models[tests] | ||
fi | ||
- name: Run pytest for changed training package | ||
if: steps.changed-packages.outputs.training_changed == 'true' | ||
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
install-dependencies: false | ||
custom-pytest: pytest training/tests | ||
|
||
- name: Run pytest for changed graphs package | ||
if: steps.changed-packages.outputs.graphs_changed == 'true' | ||
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
install-dependencies: false | ||
custom-pytest: pytest graphs/tests | ||
|
||
- name: Run pytest for changed models package | ||
if: steps.changed-packages.outputs.models_changed == 'true' | ||
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
install-dependencies: false | ||
custom-pytest: pytest models/tests | ||
|
||
- name: Run integration tests | ||
if: success() | ||
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
install-dependencies: false |
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,12 @@ | ||
# (C) Copyright 2025 Anemoi contributors. | ||
# | ||
# This software is licensed under the terms of the Apache Licence 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. | ||
|
||
|
||
def test_dummy(): | ||
pass |