Skip to content

Commit

Permalink
Merge pull request #147 from ecmwf-actions/fix/update-and-fix-sync-files
Browse files Browse the repository at this point in the history
[Anemoi] Update and fix specific files for sync
  • Loading branch information
iainrussell authored Jan 23, 2025
2 parents 8f37af7 + 723e2ae commit c8ef029
Show file tree
Hide file tree
Showing 12 changed files with 220 additions and 121 deletions.
1 change: 1 addition & 0 deletions .github/workflows/sync-files-to-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
uses: BetaHuhn/repo-file-sync-action@v1
with:
GH_PAT: ${{ secrets.REPO_SYNC_ACTION_PAT }}
GIT_EMAIL: "[email protected]"
CONFIG_PATH: sync-files/sync.yml
COMMIT_PREFIX: "chore: "
BRANCH_PREFIX: "chore/file-broadcast/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
34 changes: 34 additions & 0 deletions sync-files/anemoi/.github/workflows/push-to-private.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{% raw %}name: Push to private repository

on:
push:
branches:
- main

jobs:
push_changes:
if: ${{ !contains(github.repository, 'private') }}{% endraw %}
runs-on: ubuntu-latest

steps:
- name: Checkout source repository
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true

- name: Set up Git configuration
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Setup SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.KEY_TO_PRIVATE }}

- name: Push changes to private repository
run: |
git remote add private [email protected]:${{ github.repository }}-private.git
git push --set-upstream private main
{% endraw %}
14 changes: 12 additions & 2 deletions sync-files/anemoi/.github/workflows/python-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: Code Quality checks for PRs
{% raw %}name: Code Quality checks for PRs

on:
push:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
schedule:
- cron: "9 2 * * 0" # at 9:02 on sunday

jobs:
quality:
Expand All @@ -12,4 +16,10 @@ jobs:
skip-hooks: "no-commit-to-branch"

checks:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
with:
python-version: ${{ matrix.python-version }}
{% endraw %}
26 changes: 26 additions & 0 deletions sync-files/anemoi/.github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% raw %}name: Run Release Please
on:
push:
branches:
- main
- hotfix

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
# this assumes that you have created a personal access token
# (PAT) and configured it as a GitHub action secret named
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
# optional. customize path to .release-please-config.json
config-file: .release-please-config.json
# Currently releases are done from main
target-branch: ${{ github.ref_name }}
{% endraw %}
173 changes: 60 additions & 113 deletions sync-files/anemoi/.gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Byte-compiled / optimized / DLL files
# Python
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so
.Python
__pypackages__/

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
Expand All @@ -26,17 +25,7 @@ share/python-wheels/
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
# Testing and coverage
htmlcov/
.tox/
.nox/
Expand All @@ -51,74 +40,12 @@ coverage.xml
.pytest_cache/
cover/

# Translations
# Documentation
docs/_build/
/site
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.envrc
Expand All @@ -129,60 +56,80 @@ ENV/
env.bak/
venv.bak/

# Spyder project settings
# IDEs
.idea/
.spyderproject
.spyproject

# Rope project settings
.ropeproject
.vscode/
*.code-workspace
*.sublime-project
*.sublime-workspace

# mkdocs documentation
/site
# Jupyter Notebook
.ipynb_checkpoints

# mypy
# Type checking
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Data files
*.grib
*.onnx
*.ckpt
*.swp
*.npy
*.npz
*.zarr/
*.nc
*.h5
*.hdf5
*.pkl
*.parquet
*.csv
*.xlsx
*.xls

# ML artifacts
wandb/
mlruns/
lightning_logs/
*.ckpt
*.pt
*.pth
runs/
checkpoints/

# Temporary and system files
*.swp
*.download
*.out
*.sync
*.dot
*.tmp
*.log
*.log.*
.DS_Store
~*
tmp/
temp/
logs/
_dev/
outputs/
*tmp_data/

# Project specific
?
?.*
foo
bar
*.grib
*.nc
*.npz
*.zarr/
~$images.pptx
test.py
test.ipynb
cutout.png
*.out

_build/
?
?.*
~*
*.sync
_version.py
outputs/
*.to_upload
tempCodeRunnerFile.python
Untitled-*.py
4 changes: 2 additions & 2 deletions sync-files/anemoi/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
- --force-single-line-imports
- --profile black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
rev: v0.8.6
hooks:
- id: ruff
args:
Expand All @@ -64,7 +64,7 @@ repos:
hooks:
- id: pyproject-fmt
- repo: https://github.com/jshwi/docsig # Check docstrings against function sig
rev: v0.65.0
rev: v0.66.1
hooks:
- id: docsig
args:
Expand Down
1 change: 0 additions & 1 deletion sync-files/anemoi/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ sphinx:

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
Expand Down
3 changes: 3 additions & 0 deletions sync-files/anemoi/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": ""
}
Loading

0 comments on commit c8ef029

Please sign in to comment.