Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0a3e6b4
Add CI/CD workflows and modern packaging from PR #33
JanStreffing Dec 16, 2025
5d1d2a6
Remove container build workflow (Dockerfile not available)
JanStreffing Dec 16, 2025
7a78e71
Fix CI: update pixi config syntax and remove Snakemake steps
JanStreffing Dec 16, 2025
2ed9775
Fix docs workflow: use docs environment for sphinx-build
JanStreffing Dec 16, 2025
b243346
Remove docs workflow (no docs folder, missing dependencies)
JanStreffing Dec 16, 2025
dfd27e4
Add Sphinx documentation and simplified docs workflow
JanStreffing Dec 16, 2025
01d5a1f
Simplify CI: replace pixi with plain pip
JanStreffing Dec 16, 2025
e4730c0
Replace basemap with cartopy in plotting module
JanStreffing Dec 16, 2025
a82542d
Fix CI: only test modules without conda-only deps (gribapi)
JanStreffing Dec 16, 2025
57267dd
Simplify CI: remove import test (needs conda), keep syntax + code qua…
JanStreffing Dec 16, 2025
0970038
Restore pixi CI for proper testing with conda packages (eccodes, cart…
JanStreffing Dec 16, 2025
5cc9b26
Fix CI: exclude .pixi directory from linting tools
JanStreffing Dec 16, 2025
65c95d7
Fix Python 3.9 compatibility and update installation docs
JanStreffing Dec 16, 2025
c9449e8
Update LSM plotting to use PolyCollection with cell corners
JanStreffing Dec 16, 2025
0a4c317
update plot routine to use polygons
JanStreffing Dec 16, 2025
3930d62
Merge branch 'master' into pgierz_workflow
JanStreffing Dec 16, 2025
fad6dde
Use polygon method for LSM, add pyfesom2 mesh generation
JanStreffing Dec 16, 2025
1de134b
Fix pyfesom2 install reference to use main branch
JanStreffing Dec 16, 2025
606a1ca
Added a function to create the output directories for the resulting f…
FinnHeu Dec 17, 2025
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
31 changes: 31 additions & 0 deletions .github/markdown-link-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"ignorePatterns": [
{
"pattern": "^http://localhost"
},
{
"pattern": "^https://127.0.0.1"
},
{
"pattern": "^file://"
}
],
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "{{BASEURL}}/"
}
],
"httpHeaders": [
{
"urls": ["https://github.com"],
"headers": {
"Accept": "text/html"
}
}
],
"timeout": "20s",
"retryOn429": true,
"retryCount": 3,
"fallbackHttpStatus": [400, 401, 403, 404, 405, 500, 502, 503, 504]
}
117 changes: 117 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: CI

on:
push:
branches: [ master, main, develop ]
pull_request:
branches: [ master, main ]
workflow_dispatch:

jobs:
test-python:
name: Test Python Code
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1

- name: Check Python scripts syntax
run: |
pixi run python -m py_compile run_ocp_tool.py
pixi run python -m py_compile ocp_tool/*.py
echo "✓ All Python scripts have valid syntax"

- name: Test import of ocp_tool modules
run: |
pixi run python -c "
from ocp_tool.config import load_config, OCPConfig
from ocp_tool.gaussian_grids import generate_gaussian_grid
from ocp_tool.lsm import process_land_sea_mask
from ocp_tool.oasis_writer import write_oasis_grid_files
from ocp_tool.runoff import modify_runoff_map
from ocp_tool.plotting import plot_land_sea_mask
print('✓ Successfully imported all ocp_tool modules')
"

code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
environments: dev

- name: Run flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
pixi run -e dev flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,__pycache__,build,dist,.pixi
# Exit-zero treats all errors as warnings
pixi run -e dev flake8 . --count --exit-zero --max-complexity=15 --max-line-length=120 --statistics --exclude=.git,__pycache__,build,dist,.pixi

- name: Check code formatting with black
run: |
pixi run -e dev black --check --diff --exclude='(\.git|\.pixi)' . || echo "::warning::Code formatting issues found."

- name: Check import sorting with isort
run: |
pixi run -e dev isort --check-only --diff --skip .pixi . || echo "::warning::Import sorting issues found."

documentation:
name: Documentation Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check README files
run: |
for readme in README.md workflow/README.md; do
if [ -f "$readme" ]; then
echo "✓ Found $readme"
else
echo "::error::Missing $readme"
exit 1
fi
done

- name: Check for broken links in documentation
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
config-file: '.github/markdown-link-check-config.json'
continue-on-error: true

security-scan:
name: Security Scanning
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Trivy security scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
continue-on-error: true

- name: Upload Trivy results to GitHub Security
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'
continue-on-error: true
45 changes: 45 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Documentation

on:
push:
branches: [ master, main ]
paths:
- 'docs/**'
- 'ocp_tool/**'
pull_request:
branches: [ master, main ]
paths:
- 'docs/**'
- 'ocp_tool/**'
workflow_dispatch:

jobs:
build-docs:
name: Build Documentation
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install sphinx alabaster numpy scipy xarray netCDF4 pyyaml matplotlib cartopy
pip install -e .

- name: Build documentation
run: |
cd docs
sphinx-build -b html source build/html

- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/build/html/
retention-days: 30
Loading
Loading