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
37 changes: 37 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Pull Request Template

## Description
Please include a summary of the change and which issue is addressed. Please also include relevant motivation and context.

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] New model
- [ ] Code improvement
- [ ] README update

## Code Changes
### Summary of Changes
- Describe the changes made in the codebase.
- Link to any relevant issues or discussions.

### Unit Testing
- Provide a list of unit tests added or updated.
- Ensure all tests pass before submitting the PR.

## Supporting Analysis
- Provide description of analysis and relevant output

## Example Job
### Subheader Describing any Comparisons / Analysis
- Provide a description of how to execute the new feature/model.
- Compare to benchmark results if applicable.
- Include any relevant logs, graphs, or data files.

## Checklist
- [ ] Code is commented
- [ ] I have made corresponding changes to the documentation
- [ ] Unit tests are present and working

## Additional Notes
- Add any other context about the pull request here.
37 changes: 37 additions & 0 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: format-check

on:
push:
branches:
- 'main'
pull_request:
branches:
- dev*
- staging
- main

jobs:
format_check:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate

- name: Install black in virtual environment
run: |
venv/bin/pip install black

- name: Check Python Code Formatting
run: |
venv/bin/black --check --diff ./cellmodeller/
venv/bin/black --check --diff ./scripts/
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@v1.18.0
58 changes: 58 additions & 0 deletions .github/workflows/validate-branch-targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Validate PR Branch Targets

on:
pull_request:
branches:
- dev*
- staging
- main

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Check branch naming and targets
run: |
HEAD="${{ github.head_ref }}"
BASE="${{ github.base_ref }}"

echo "Head branch: $HEAD"
echo "Base branch: $BASE"

#
# === ALLOWED HEAD BRANCH PATTERNS ===
#
if [[ ! "$HEAD" =~ ^(feature|bug|hotfix)/ && ! "$HEAD" =~ ^dev.*$ && "$HEAD" != "staging" ]]; then
echo "❌ Branch name must start with 'feature/', 'bug/', 'hotfix/', 'dev*', or be 'staging'."
exit 1
fi

#
# === MERGE RULES ===
#

# 1. feature/bug/hotfix/dev* may NOT merge directly into main
if [[ ( "$HEAD" =~ ^(feature|bug|hotfix)/ || "$HEAD" =~ ^dev.*$ ) && "$BASE" == "main" ]]; then
echo "❌ '$HEAD' cannot merge into 'main'. Merge into 'staging' instead."
exit 1
fi

# 2. feature/bug/hotfix branches may only merge into dev* or staging
if [[ "$HEAD" =~ ^(feature|bug|hotfix)/ && ! "$BASE" =~ ^(dev.*|staging)$ ]]; then
echo "❌ Feature/bug/hotfix branches may only merge into 'dev*' or 'staging'."
exit 1
fi

# 3. dev* branches may only merge into staging or other dev* branches
if [[ "$HEAD" =~ ^dev.*$ && ! "$BASE" =~ ^(staging|dev.*)$ ]]; then
echo "❌ Dev* branches may only merge into 'staging' or another dev* branch."
exit 1
fi

# 4. staging may only merge into main
if [[ "$HEAD" == "staging" && "$BASE" != "main" ]]; then
echo "❌ 'staging' may only merge into 'main'."
exit 1
fi

echo "✅ PR branch name and target are valid."
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
__pycache__/
*.py[cod]
*.egg-info/
build/
dist/
.eggs/
.ipynb_checkpoints/
.vscode/
.idea/
.DS_Store
data/
Loading
Loading