Skip to content
Open
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
34 changes: 34 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Problem
<!-- What feature are you adding, or what is broken/missing/sub-optimal? -->
<!-- Context, symptoms, motivation. Link the issue. -->

Issue: #

---

## Solution
<!-- What you changed and why this approach -->
<!-- Key design decisions / tradeoffs -->
<!-- Keep it high-signal; deep planning belongs in the issue. -->

---

## Breaking Changes
<!-- Write "None" if not applicable -->

None

<!-- If applicable:
- What breaks
- Who is affected
- Migration steps
-->

---

## How to Test
<!-- MUST be reproducible. If this section is weak, reviewers can't approve confidently. -->

### One-command PR verification (required)
```bash
bash scripts/test_pr.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for? I think people have to add their own command for how to test it.

21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PR Tests

on:
pull_request:

permissions:
contents: write
packages: write
pull-requests: read
workflows: write

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

- name: Run PR test script
run: bash scripts/test_pr.sh

31 changes: 31 additions & 0 deletions CLA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributor License Agreement (CLA)

Thank you for your interest in contributing to the DimOS project maintained by Dimensional Inc..

For the purposes of this agreement, a "Contribution" means any code, documentation, or other material intentionally submitted for inclusion in the project.

In order to accept contributions, we require contributors to agree to the following terms.

## 1. Grant of License

By submitting a contribution, you grant the project maintainers and users a perpetual, worldwide, non-exclusive, royalty-free license to use, reproduce, modify, distribute, and sublicense your contribution as part of the project.

All contributions will be licensed under the terms of the repository's LICENSE file unless otherwise stated.

## 2. Ownership and Rights

You represent that:

- You are the original author of the contribution, or
- You have the legal right to submit the contribution, and
- The contribution does not knowingly violate the rights of any third party.

If you are contributing on behalf of an employer, you represent that your employer has authorized the contribution.

## 3. No Warranty

Contributions are provided "as is" without warranties or conditions of any kind.

## 4. Agreement

By submitting a pull request to this repository, you agree to the terms of this Contributor License Agreement.
68 changes: 68 additions & 0 deletions scripts/test_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash
set -euo pipefail

echo "== PR Test Script =="
echo "Repo: $(basename "$(git rev-parse --show-toplevel)")"
echo "Commit: $(git rev-parse --short HEAD)"
echo

ran_anything=0

# -------- Python (if present) --------
if [[ -f "pyproject.toml" || -f "requirements.txt" ]]; then
ran_anything=1
echo "== Python checks =="
python -V
python -m pip --version
python -m pip install --upgrade pip

if [[ -f "requirements.txt" ]]; then
python -m pip install -r requirements.txt
fi

# If you have a dev requirements file, this is common:
if [[ -f "requirements-dev.txt" ]]; then
python -m pip install -r requirements-dev.txt
fi

# Require pytest if this is a Python repo
if ! command -v pytest >/dev/null 2>&1; then
echo "ERROR: pytest not installed. Add it to requirements-dev.txt (or project deps)."
exit 1
fi

# Lint/format are optional, but if present, run them
command -v ruff >/dev/null 2>&1 && ruff check .
command -v black >/dev/null 2>&1 && black --check .

pytest -q
echo
fi

# -------- Node (if present) --------
if [[ -f "package.json" ]]; then
ran_anything=1
echo "== Node checks =="
npm ci
npm test
echo
fi

# -------- CMake/C++ (if present) --------
if [[ -f "CMakeLists.txt" ]]; then
ran_anything=1
echo "== CMake checks =="
rm -rf build
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build --output-on-failure
echo
fi

if [[ "$ran_anything" -eq 0 ]]; then
echo "ERROR: No recognized project type detected (no pyproject.toml/requirements.txt/package.json/CMakeLists.txt)."
echo "Add checks for your repo’s build/test commands."
exit 1
fi

echo "✅ All PR checks passed."
Loading