chore: document feature worktree workflow #91
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| # Lint + every test suite for subgen. These four checks gate every PR into main: | |
| # branch protection requires all of them green and forbids direct pushes to main, so | |
| # nothing lands without lint + unit + integration + apitest passing. | |
| # lint — golangci-lint v2 (make lint) | |
| # unit — go test -race (make test) | |
| # integration — -tags integration, real temp SQLite (make integration) | |
| # apitest — -tags apitest, two real 3x-ui panels in docker (make apitest) | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| # A newer push to the same ref supersedes an in-flight run (saves runner minutes, | |
| # especially the docker apitest job). | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # Lint via `make lint` — the single source of truth (pinned golangci-lint Docker | |
| # image), byte-identical to a developer's local run. No setup-go: golangci-lint runs | |
| # inside the container. The cache holds go modules + build/analysis cache for speed. | |
| - name: lint cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .lintcache | |
| key: lint-${{ runner.os }}-${{ hashFiles('go.sum', '.golangci.yaml', 'Makefile') }} | |
| restore-keys: lint-${{ runner.os }}- | |
| - name: make lint | |
| run: make lint | |
| unit: | |
| name: unit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: unit tests (-race) | |
| run: make test | |
| integration: | |
| name: integration | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: integration tests (real temp SQLite) | |
| run: make integration | |
| apitest: | |
| name: apitest | |
| needs: [unit, integration] # only spin the docker panels once the cheap suites are green | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: API tests | |
| # `make apitest` delegates to apitest/Makefile: docker compose up two clean | |
| # panels → fetch their api tokens → go test -tags apitest ./apitest/... → down. | |
| # ubuntu-latest ships docker + docker compose; the 3x-ui image is public on ghcr. | |
| run: make apitest |