chore: start 0.2.1 development #397
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 | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| NODE_VERSION: "26" | |
| PNPM_VERSION: "11.13.1" | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| go: | |
| name: Go | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| env: | |
| POSTGRES_DB: clickclack_test | |
| POSTGRES_PASSWORD: clickclack | |
| POSTGRES_USER: clickclack | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U clickclack -d clickclack_test" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| CLICKCLACK_POSTGRES_TEST_DSN: postgres://clickclack:clickclack@127.0.0.1:5432/clickclack_test?sslmode=disable | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Download modules | |
| run: go mod download | |
| - name: Check gofmt | |
| run: | | |
| files="$(gofmt -l apps/api)" | |
| if [ -n "$files" ]; then | |
| echo "$files" | |
| exit 1 | |
| fi | |
| - name: Test | |
| run: go test ./... | |
| - name: Deadcode | |
| run: | | |
| output_file=$(mktemp) | |
| go run golang.org/x/tools/cmd/deadcode@v0.45.0 -test ./... > "$output_file" | |
| if [ -s "$output_file" ]; then | |
| cat "$output_file" | |
| exit 1 | |
| fi | |
| - name: Coverage gate | |
| run: bash scripts/check-go-coverage.sh | |
| typescript: | |
| name: TypeScript | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@008330803749db0355799c700092d9a85fd074e9 # v6.0.9 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Node | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Check TypeScript formatting | |
| run: pnpm fmt:ts:check | |
| - name: Lint TypeScript | |
| run: pnpm lint | |
| - name: Test FakeCo AWS owner | |
| run: pnpm test:fakeco-aws | |
| - name: Typecheck root tests | |
| run: pnpm typecheck | |
| - name: Typecheck workspaces | |
| run: pnpm -r typecheck | |
| - name: Verify embedded app build is current and repeatable | |
| run: | | |
| pnpm build | |
| git diff --exit-code -- apps/api/internal/webassets/dist | |
| pnpm build | |
| git diff --exit-code -- apps/api/internal/webassets/dist | |
| - name: Build docs site | |
| run: pnpm docs:site | |
| e2e: | |
| name: Playwright E2E | |
| needs: | |
| - go | |
| - typescript | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/playwright:v1.61.1-noble | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@008330803749db0355799c700092d9a85fd074e9 # v6.0.9 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| - name: Set up Node | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Download Go modules | |
| run: go mod download | |
| - name: Run e2e tests | |
| run: pnpm test:e2e | |
| docker: | |
| name: Docker Image | |
| needs: | |
| - go | |
| - typescript | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Build image | |
| run: docker build -t clickclack:ci . |