Files
eleith 218b333109
ci/woodpecker/pr/web Pipeline was successful
ci/woodpecker/push/web Pipeline was successful
[web] add browser tests for editing and search
2026-11-04 18:44:56 -08:00

159 lines
4.4 KiB
YAML

workspace:
base: /workspace
path: src
when:
- event: push
branch: main
path:
include:
- ".woodpecker/.web.yml"
- "apps/web/**"
- "packages/web/config/**"
- "packages/web/theme/**"
- "packages/web/db/**"
- "packages/web/jobs/**"
- "packages/web/pieces/**"
- "packages/web/templates/**"
- event: pull_request
path:
include:
- ".woodpecker/.web.yml"
- "apps/web/**"
- "packages/web/config/**"
- "packages/web/theme/**"
- "packages/web/db/**"
- "packages/web/jobs/**"
- "packages/web/pieces/**"
- "packages/web/templates/**"
- "apps/core/**"
- event: tag
ref: "refs/tags/@luzzle/web@*"
steps:
prepare:
image: node:26
environment:
COREPACK_HOME: /workspace/src/.corepack
LUZZLE_NPMRC:
from_secret: luzzle_npmrc
commands:
- printf '%s' "$LUZZLE_NPMRC" | sed 's/[[:space:]]*$//' >> .npmrc
- npm install --global corepack@latest
- corepack enable
- corepack prepare pnpm@11.2.2 --activate
- pnpm config set store-dir .pnpm-store
- pnpm install --frozen-lockfile
- pnpm --filter @luzzle/core --filter @luzzle/web.config --filter @luzzle/web.theme --filter @luzzle/web.db --filter @luzzle/web.jobs --filter @luzzle/web.pieces --filter @luzzle/web.templates build
lint:
image: node:26
environment:
COREPACK_HOME: /workspace/src/.corepack
commands:
- npm install --global corepack@latest
- corepack enable
- cd apps/web
- touch config.yaml
- touch .env
- pnpm run lint
- pnpm run check
test:
# Same browser version as @playwright/test, using the Gitea mirror.
image: git.eleith.com/eleith.private/playwright:1.61.1-node26
environment:
COREPACK_HOME: /workspace/src/.corepack
commands:
- npm install --global corepack@latest
- corepack enable
- pnpm --filter @luzzle/web test
- pnpm --filter @luzzle/web test:templates
- pnpm --filter @luzzle/web test:e2e
check-version:
image: node:26
commands:
- cd apps/web
- |
VERSION_FROM_PKG=$(node -p "require('./package.json').version")
if [ "$VERSION_FROM_TAG" != "$VERSION_FROM_PKG" ]; then
echo "Version mismatch: Git tag version $VERSION_FROM_TAG does not match package.json version: $VERSION_FROM_PKG"
exit 1
fi
environment:
VERSION_FROM_TAG: "${CI_COMMIT_TAG#@luzzle/web@}"
when:
- event: tag
extract-semver-tags:
image: alpine/git:latest
commands:
- |
VERSION_FULL="${CI_COMMIT_TAG#@luzzle/web@}"
VERSION_MAJOR=$(echo "$VERSION_FULL" | cut -d. -f1)
VERSION_MINOR=$(echo "$VERSION_FULL" | cut -d. -f2)
SEMVER_FULL="$VERSION_FULL"
SEMVER_MAJOR_MINOR="$VERSION_MAJOR.$VERSION_MINOR"
SEMVER_MAJOR="$VERSION_MAJOR"
echo "Extracted versions: $SEMVER_FULL, $SEMVER_MAJOR_MINOR, $SEMVER_MAJOR, "
echo -e "$SEMVER_FULL\n$SEMVER_MAJOR\n$SEMVER_MAJOR_MINOR" >> .tags
cat .tags
when:
- event: tag
build-docker-main:
image: woodpeckerci/plugin-docker-buildx:6.0.3
settings:
repo: git.eleith.com/eleith.private/luzzle-web
username: eleith
dockerfile: apps/web/Dockerfile
context: .
registry: https://git.eleith.com
secrets:
- 'id=npmrc\,src=.npmrc'
tags:
- latest
password:
from_secret: gitea_docker_registry
when:
- event: push
branch: main
build-docker-tag:
image: woodpeckerci/plugin-docker-buildx:6.0.3
settings:
repo: git.eleith.com/eleith.private/luzzle-web
username: eleith
dockerfile: apps/web/Dockerfile
context: .
registry: https://git.eleith.com
secrets:
- 'id=npmrc\,src=.npmrc'
tags_file: .tags
password:
from_secret: gitea_docker_registry
when:
- event: tag
notify:
image: deblan/woodpecker-email:3.3.0
settings:
dsn:
from_secret: woodpecker_email_dsn
from:
address:
from_secret: woodpecker_email_from_address
name:
from_secret: woodpecker_email_from_name
recipients:
from_secret: woodpecker_email_recipient
recipients_only: true
when:
- event: push
branch: main
status: [failure, success]