# CI workflow: one clone, one workspace — install → lint → build → unit test - e2e test. # Runs on pull requests, push/tag/manual on main, or manual from any branch. # Deploy workflow depends on this (ci) and runs only on main. when: - event: pull_request - event: push branch: main - event: tag - event: manual steps: - name: install image: node:20-alpine commands: - corepack enable && corepack prepare pnpm@10.28.2 --activate - pnpm install --frozen-lockfile || pnpm install - name: lint image: node:20-alpine commands: - corepack enable && corepack prepare pnpm@10.28.2 --activate - pnpm install --frozen-lockfile || pnpm install - pnpm run lint - pnpm run lint:css depends_on: - install - name: Send Lint Status Notification (failure) image: curlimages/curl environment: MATTERMOST_WEBHOOK_URL: from_secret: mattermost_test_webhook commands: - | BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] Lint failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL" depends_on: - lint when: - status: [failure] - name: build image: node:20-alpine commands: - corepack enable && corepack prepare pnpm@10.28.2 --activate - pnpm install --frozen-lockfile || pnpm install - pnpm run build depends_on: - install - name: Send Test Build Status Notification (failure) image: curlimages/curl environment: MATTERMOST_WEBHOOK_URL: from_secret: mattermost_test_webhook commands: - | BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] Test build failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL" depends_on: - build when: - status: [failure] - name: unit test image: node:20-alpine commands: - corepack enable && corepack prepare pnpm@10.28.2 --activate - pnpm install --frozen-lockfile || pnpm install - pnpm test depends_on: - install - name: Send Unit Test Status Notification (failure) image: curlimages/curl environment: MATTERMOST_WEBHOOK_URL: from_secret: mattermost_test_webhook commands: - | BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] Unit test failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL" depends_on: - unit test when: - status: [failure] - name: e2e test image: mcr.microsoft.com/playwright:v1.58.0-noble commands: - corepack enable && corepack prepare pnpm@10.28.2 --activate - pnpm install --frozen-lockfile || pnpm install - pnpm run build - npx serve dist -p 4173 & - sleep 2 - CI=1 pnpm run test:e2e depends_on: - unit test - name: Send E2E Test Status Notification (failure) image: curlimages/curl environment: MATTERMOST_WEBHOOK_URL: from_secret: mattermost_test_webhook commands: - | BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] E2E test failure 💩"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL" depends_on: - e2e test when: - status: [failure] - name: Send CI Pipeline Status Notification (success) image: curlimages/curl environment: MATTERMOST_WEBHOOK_URL: from_secret: mattermost_test_webhook commands: - | BODY=$(printf '{"username":"WoodpeckerBot","text":"[%s - Build #%s] CI pipeline success 🎉"}' "$CI_REPO" "$CI_PIPELINE_NUMBER") curl -sS -X POST -H "Content-Type: application/json" -d "$BODY" "$MATTERMOST_WEBHOOK_URL" depends_on: - install - lint - build - unit test - e2e test when: - status: [success]