chore: add GitHub templates and CI workflow (#38)

- Add issue templates (feature, bug, infra, docs)
- Add PR template
- Add CI workflow (lint, build, test)

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-authored-by: Alexa Louise <YOUR_REAL_EMAIL@EXAMPLE.COM>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Alexa Amundson
2025-11-28 21:04:24 -06:00
committed by GitHub
parent 752516bc11
commit 9658ea2652
7 changed files with 176 additions and 107 deletions

33
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,33 @@
---
name: Bug Report
about: Report something that isn't working correctly
title: "[Bug] "
labels: type:bug, status:backlog
assignees: ''
---
## Summary
<!-- One-sentence description of the bug -->
## Steps to Reproduce
1. Go to '...'
2. Click on '...'
3. See error
## Expected Behavior
<!-- What should happen? -->
## Actual Behavior
<!-- What actually happens? -->
## Environment
- Service/Repo:
- Environment: (local / staging / prod)
- Browser/Client: (if applicable)
- OS:
## Logs / Screenshots
<!-- Paste relevant logs or attach screenshots -->
## Possible Fix
<!-- If you have ideas on how to fix this -->

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: BlackRoad OS Docs
url: https://github.com/BlackRoad-OS/blackroad-os-docs
about: Check the docs before opening an issue

22
.github/ISSUE_TEMPLATE/doc_update.md vendored Normal file
View File

@@ -0,0 +1,22 @@
---
name: Documentation Update
about: Improve or add documentation
title: "[Docs] "
labels: type:doc, team:docs, status:backlog
assignees: ''
---
## Summary
<!-- What documentation needs to be added/updated? -->
## Location
<!-- Which file(s) or section(s)? -->
## Current State
<!-- What's missing or incorrect? -->
## Proposed Content
<!-- Outline or draft of the new content -->
## Related
<!-- Links to related issues, PRs, or external docs -->

View File

@@ -0,0 +1,26 @@
---
name: Feature Request
about: Propose a new feature or capability
title: "[Feature] "
labels: type:feature, status:backlog
assignees: ''
---
## Summary
<!-- One-sentence description of the feature -->
## Problem / Motivation
<!-- What problem does this solve? Why do we need it? -->
## Proposed Solution
<!-- How should this work? Be specific. -->
## Alternatives Considered
<!-- What other approaches did you consider? Why not those? -->
## Acceptance Criteria
- [ ] Criterion 1
- [ ] Criterion 2
## Additional Context
<!-- Screenshots, links, related issues -->

29
.github/ISSUE_TEMPLATE/infra_task.md vendored Normal file
View File

@@ -0,0 +1,29 @@
---
name: Infrastructure Task
about: CI/CD, deployment, DevOps work
title: "[Infra] "
labels: type:infra, team:infra, status:backlog
assignees: ''
---
## Summary
<!-- One-sentence description of the infra task -->
## Scope
- [ ] CI/CD pipeline
- [ ] Deployment config
- [ ] Monitoring/Observability
- [ ] Security
- [ ] Other:
## Current State
<!-- What exists now? -->
## Desired State
<!-- What should exist after this work? -->
## Affected Services
<!-- Which repos/services does this touch? -->
## Rollback Plan
<!-- How do we undo this if something goes wrong? -->

39
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,39 @@
## Summary
<!-- What does this PR do? One paragraph max. -->
## Changes
<!-- Bulleted list of specific changes -->
-
## Type
<!-- Check one -->
- [ ] Feature
- [ ] Bug fix
- [ ] Infrastructure / CI
- [ ] Documentation
- [ ] Refactor
- [ ] Config change
## Tests
<!-- How was this tested? -->
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing (describe below)
- [ ] N/A (docs only)
**Manual testing steps:**
## Risk / Impact
<!-- What could go wrong? What's the blast radius? -->
- Risk level: Low / Medium / High
- Affected services:
## Checklist
- [ ] Code follows project conventions
- [ ] No secrets or credentials committed
- [ ] README updated (if applicable)
- [ ] This is a single logical change (atomic PR)
## Related Issues
<!-- Closes #123, Relates to #456 -->

View File

@@ -1,125 +1,40 @@
name: CI name: CI
permissions:
contents: read
on: on:
pull_request:
push: push:
branches: branches: [main]
- main pull_request:
- work branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
lint-and-test: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Python - name: Setup Node
uses: actions/setup-python@v5 uses: actions/setup-node@v4
with: with:
python-version: '3.11' node-version: '20'
cache: 'npm'
- name: Install dependencies - name: Install dependencies
run: | run: npm ci
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Ruff - name: Lint
run: ruff check . run: npm run lint --if-present
- name: Run Tests - name: Type check
run: pytest run: npm run type-check --if-present
on: - name: Build
push: run: npm run build --if-present
branches:
- feat/api-gateway-v1
pull_request:
permissions: - name: Test
contents: read run: npm test --if-present
pages: write
id-token: write
pull-requests: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: pip install poetry==2.2.1
- name: Install dependencies
run: poetry install --no-interaction
- name: Run pytest
run: poetry run pytest
- name: Run schemathesis contract checks
run: |
poetry run uvicorn app.main:app --host 0.0.0.0 --port 8000 &
SERVER_PID=$!
sleep 2
poetry run schemathesis run --checks all --data-generation-methods positive --max-examples 5 --base-url http://127.0.0.1:8000 openapi.yaml
kill $SERVER_PID
publish-openapi:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/feat/api-gateway-v1'
steps:
- uses: actions/checkout@v4
- name: Upload OpenAPI artifact
uses: actions/upload-artifact@v4
with:
name: openapi.yaml
path: openapi.yaml
- name: Prepare Swagger UI preview
run: |
mkdir -p public
cp openapi.yaml public/openapi.yaml
cat > public/index.html <<'HTML'
<!doctype html>
<html>
<head>
<title>BlackRoad OS API Swagger Preview</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css">
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
<script>
SwaggerUIBundle({ url: './openapi.yaml', dom_id: '#swagger-ui' });
</script>
</body>
</html>
HTML
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./public
- name: Deploy Swagger preview
id: deployment
uses: actions/deploy-pages@v4
- name: Comment PR with Swagger link
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const url = "${{ steps.deployment.outputs.page_url }}";
const body = `Swagger UI preview: ${url}`;
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}