diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32048b8..0d7a4d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: CI on: push: branches: [main] + pull_request: + branches: [main] permissions: contents: read diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0dccdcf --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,99 @@ +# Contributing to SecGo + +Thanks for helping improve SecGo! This repo enforces a **PR-first** workflow and requires CI to pass before merging to `main`. + +--- + +## โœ… Workflow Summary + +1. **Create a branch** off `main`. +2. **Make changes locally**. +3. **Run checks locally** (lint + tests). +4. **Open a PR** into `main`. +5. **Wait for CI** to pass and get at least **1 approval**. +6. **Merge via PR** (no direct pushes to `main`). + +--- + +## ๐ŸŒฟ Branch Naming + +Use a descriptive prefix: + +- `feature/` โ€” new features +- `fix/` โ€” bug fixes +- `chore/` โ€” tooling, docs, refactors +- `docs/` โ€” documentation only + +Examples: +- `feature/kiosk-scan-overlay` +- `fix/manager-sync-timeout` +- `chore/ci-main-only` + +--- + +## ๐Ÿงช Local Checks + +Run these from the app folders before opening a PR: + +### Kiosk +```bash +cd Kiosk +flutter pub get +flutter analyze +flutter test +``` + +### Manager +```bash +cd Manager +flutter pub get +flutter analyze +flutter test +``` + +> Integration tests are optional locally (device required) but encouraged when touching user flows. + +--- + +## ๐Ÿงท Environment Setup + +Use the provided templates: + +- `Kiosk/.env_template` +- `Manager/.env_template` + +Copy to `.env` and fill values: +```bash +cp Kiosk/.env_template Kiosk/.env +cp Manager/.env_template Manager/.env +``` + +--- + +## โœ… PR Requirements + +- **At least 1 approval** +- **CI passes** (lint + tests) +- **No direct pushes** to `main` + +--- + +## ๐Ÿงพ Commit Style + +Keep commits small and meaningful. Suggested format: + +``` +: + +- bullet 1 +- bullet 2 +``` + +Examples: +- `feat: add kiosk pairing retry` +- `fix: handle null barcode in scanner` +- `chore: update ci workflow` + +--- + +Thanks for contributing! ๐Ÿ™Œ