Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
87 changes: 87 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# PR Summary

Code Reviewer: <!-- CR id, filled by SSD -->

<!-- To be completed by the developer -->

<!-- Provide a brief description of the changes in this PR, including any notes
useful for reviewers -->

<!-- List any linked PRs here
- linked MetOffice/<REPO-NAME>#<pr-number>
-->

<!-- List any blocking PRs or issues to be closed here
- is blocked-by #pr-number
- blocks #pr-number
- closes #issue-number
- fixes #issue-number
- is related to #issue-number
-->

## Code Quality Checklist

(_Some checks are automatically carried out via the CI pipeline_)

- [ ] I have performed a self-review of my own code
- [ ] My code follows the project's style guidelines
- [ ] Comments have been included that aid undertanding and enhance the
readability of the code
- [ ] My changes generate no new warnings

## Testing

- [ ] I have tested this change locally, using the rose-stem suite
- [ ] If any tests fail (rose-stem or CI) the reason is understood and
acceptable (eg. kgo changes)
- [ ] I have added tests to cover new functionality as appropriate (eg. system
tests, unit tests, etc.)

<!-- Describe other testing performed (if applicable) -->

### trac.log

<!-- Paste your trac.log from testing output here -->

## Security Considerations

- [ ] This change does not introduce security vulnerabilities
- [ ] I have reviewed the code for potential security issues
- [ ] Sensitive data is properly handled (if applicable)
- [ ] Authentication and authorisation are properly implemented (if applicable)

## Performance Impact

- [ ] Performance of the code has been considered and, if applicable, suitable
performance measurements have been conducted

## Contributor License Agreement (CLA)

- [ ] **Required** - I confirm that I have read and agree to the project's
[Contributor License Agreement](todo-enter-link-to-cla)

## AI Assistance and Attribution

- [ ] Some of the content of this change has been produced with the assistance
of _Generative AI tool name_ (e.g., Met Office Github Copilot Enterprise,
Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the
[Simulation Systems AI policy](todo-enter-link-to-policy-page) (including
attribution labels)

## Documentation

- [ ] Where appropriate I have updated documentation related to this change and
confirmed that it builds correctly

# Code Review

<!-- To be completed by the Code Reviewer -->

- [ ] All dependencies have been resolved
- [ ] Related Issues are properly linked and addressed
- [ ] CLA compliance is confirmed
- [ ] Code quality standards are met
- [ ] Tests are adequate and passing
- [ ] Documentation is complete and accurate
- [ ] Security considerations have been addressed
- [ ] Performance impact is acceptable
48 changes: 48 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Quality

on: # yamllint disable-line rule:truthy
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions: read-all

jobs:

mule-checks:
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: uv sync
- name: Python Lint
run: uv run ruff check .
- name: Python Format Check
if: always()
run: uv run ruff format --check --diff -s --respect-gitignore .
- name: Shell Check
if: always()
run: |
find . -type f \( -name "*.*sh" -o ! -name "*.*" \) \
-not -path "*.git/*" -not -path "*.venv/*" -print0 \
| xargs -0 file | grep "shell script" | cut -d: -f1 \
| xargs -r uv run shellcheck -S warning \
&& echo "All checks passed!"
- name: CPPLINT
# See: CPPLINT.cfg
if: always()
run: |
uv run cpplint --recursive --extensions=c,h \
--exclude=.git --exclude=.venv .
- name: Minimize uv cache
run: uv cache prune --ci
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: CI
on: # yamllint disable-line rule:truthy
push:
branches:
- main
- 'releases/**'
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

permissions: read-all

jobs:
build-test-mule:
runs-on: ubuntu-24.04
timeout-minutes: 5
strategy:
max-parallel: 4
matrix:
python-version: ['3.12', '3.13']
numpy-version: ['1.26.4', '2.2.6']
exclude:
- python-version: '3.13'
numpy-version: '1.26.4'

steps:
- name: Checkout Mule
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install Python Dependencies ${{ matrix.numpy-version }}
run: |
pip install setuptools
pip install six
pip install numpy==${{ matrix.numpy-version }}
- name: Build python-${{ matrix.python-version }}_numpy-${{ matrix.numpy-version }}
run: |
./admin/install_mule.sh ./_build/lib ./_build/bin
- name: Test python-${{ matrix.python-version }}_numpy-${{ matrix.numpy-version }}
run: |
cd _build/lib
for name in ./*; do
python -m unittest discover -v ${name##*/}.tests
done
67 changes: 67 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Docs

on: # yamllint disable-line rule:truthy
push:
branches:
- main
- 'releases/**'
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'mule/docs/**'
- '.github/workflows/docs.yaml'
workflow_dispatch:

permissions: read-all

jobs:

build-docs:
runs-on: ubuntu-latest
timeout-minutes: 3

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: uv sync && uv pip install ./mule ./um_utils
- name: Build mule docs
run: uv run make clean html --directory ./mule/docs
working-directory: ${{ github.workspace }}
- name: Build um_utils docs
run: uv run make clean html --directory ./um_utils/docs
working-directory: ${{ github.workspace }}
# - id: permissions
# name: Set permissions
# run: |
# chmod -c -R +rX "./doc/_build/html/"
- name: Upload artifacts
uses: actions/upload-pages-artifact@v4
with:
name: github-pages
path: ./mule/docs/build/html
- name: Minimize uv cache
if: always()
run: uv cache prune --ci

# Deploy job
deploy:
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
# Add a dependency to the build job
needs: build-docs
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading