chore: relocate example and service template docs #214
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: Merrymaker Go CI | |
| on: | |
| push: | |
| paths: | |
| - "services/merrymaker-go/**" | |
| - ".github/workflows/merrymaker-go.yml" | |
| pull_request: | |
| paths: | |
| - "services/merrymaker-go/**" | |
| - ".github/workflows/merrymaker-go.yml" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: mmk-go-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GOFLAGS: -buildvcs=false | |
| jobs: | |
| lint: | |
| name: GolangCI-Lint | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: services/merrymaker-go | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup Go | |
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 | |
| with: | |
| go-version-file: services/merrymaker-go/go.mod | |
| check-latest: true | |
| cache: true | |
| cache-dependency-path: services/merrymaker-go/go.sum | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: "1.3.13" | |
| - name: Build frontend assets (embed targets) | |
| working-directory: services/merrymaker-go/frontend | |
| run: | | |
| bun install --frozen-lockfile | |
| bun run build | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 | |
| with: | |
| version: v2.10.1 | |
| working-directory: services/merrymaker-go | |
| gosec: | |
| name: GoSec | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: services/merrymaker-go | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup Go | |
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 | |
| with: | |
| go-version-file: services/merrymaker-go/go.mod | |
| check-latest: true | |
| cache: true | |
| cache-dependency-path: services/merrymaker-go/go.sum | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: "1.3.13" | |
| - name: Build frontend assets (embed targets) | |
| working-directory: services/merrymaker-go/frontend | |
| run: | | |
| bun install --frozen-lockfile | |
| bun run build | |
| - name: Install gosec | |
| # GOTOOLCHAIN=auto allows Go to fetch a newer toolchain if gosec@latest | |
| # requires a Go version newer than the one declared in go.mod. | |
| env: | |
| GOTOOLCHAIN: auto | |
| run: go install github.com/securego/gosec/v2/cmd/gosec@latest | |
| - name: Run gosec | |
| # Pre-existing findings (G101/G124/G202/G706/G710) tracked via Security tab. | |
| # Remove continue-on-error once remediation PRs are merged. | |
| continue-on-error: true | |
| run: gosec ./... | |
| test: | |
| name: Go Tests (integration) | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: services/merrymaker-go | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_DB: merrymaker | |
| POSTGRES_USER: merrymaker | |
| POSTGRES_PASSWORD: merrymaker | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup Go | |
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 | |
| with: | |
| go-version-file: services/merrymaker-go/go.mod | |
| check-latest: true | |
| cache: true | |
| cache-dependency-path: services/merrymaker-go/go.sum | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: "1.3.13" | |
| - name: Build frontend assets (embed targets) | |
| working-directory: services/merrymaker-go/frontend | |
| run: | | |
| bun install --frozen-lockfile | |
| bun run build | |
| - name: Install DB clients | |
| run: sudo apt-get update && sudo apt-get install -y postgresql-client redis-tools | |
| - name: Wait for Postgres | |
| run: | | |
| for i in {1..30}; do | |
| if pg_isready -h 127.0.0.1 -p 5432 -U merrymaker >/dev/null 2>&1; then | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "Postgres did not become ready in time" >&2 | |
| exit 1 | |
| - name: Wait for Redis | |
| run: | | |
| for i in {1..30}; do | |
| if redis-cli -h 127.0.0.1 -p 6379 ping >/dev/null 2>&1; then | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "Redis did not become ready in time" >&2 | |
| exit 1 | |
| - name: Run Go tests | |
| env: | |
| TEST_DB_HOST: 127.0.0.1 | |
| TEST_DB_PORT: "5432" | |
| TEST_DB_USER: merrymaker | |
| TEST_DB_PASSWORD: merrymaker | |
| TEST_DB_NAME: merrymaker | |
| TEST_DB_EPHEMERAL: "1" | |
| DB_SSL_MODE: disable | |
| TEST_REQUIRE_INFRA: "1" | |
| REDIS_ADDR: 127.0.0.1:6379 | |
| run: go test ./... | |
| frontend: | |
| name: Frontend Lint & Test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: services/merrymaker-go/frontend | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 | |
| with: | |
| bun-version: "1.3.13" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Lint frontend | |
| run: bun run lint | |
| - name: Test frontend | |
| run: bun run test | |
| puppeteer-worker: | |
| name: Puppeteer Worker Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true" | |
| PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome" | |
| NODE_OPTIONS: "--max-old-space-size=4096" | |
| TMPDIR: /home/runner/work/_temp | |
| services: | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| defaults: | |
| run: | |
| working-directory: services/puppeteer-worker | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Setup Node | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| cache-dependency-path: services/puppeteer-worker/package-lock.json | |
| - name: Install Google Chrome | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y wget fonts-liberation | |
| wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
| sudo apt-get install -y ./google-chrome-stable_current_amd64.deb | |
| rm -f google-chrome-stable_current_amd64.deb | |
| google-chrome --version | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint (Biome) | |
| run: npm run lint | |
| - name: Test | |
| run: npm test |