Newer
Older
gnexus-ui-kit / .gitlab-ci.yml
@Eugene Sukhodolskiy Eugene Sukhodolskiy 1 day ago 1 KB Add demo-sync gate and GitLab CI
# CI for gnexus-ui-kit.
# The Playwright image version must match the installed @playwright/test
# version (browsers are preinstalled there, so no `playwright install`).
image: mcr.microsoft.com/playwright:v1.60.0-noble

stages:
  - build
  - test

variables:
  npm_config_cache: "$CI_PROJECT_DIR/.npm-cache"

cache:
  key:
    files:
      - package-lock.json
  paths:
    - .npm-cache

build:
  stage: build
  script:
    - npm ci
    - npm ci --prefix examples/vue
    - npx gulp build
  artifacts:
    paths:
      - dist/
    expire_in: 1 hour

test:
  stage: test
  script:
    - npm ci
    - npm ci --prefix examples/vue
    - npx gulp build
    # compare-heights.js (test:demo-sync) needs the demo server on :3000
    - npx gulp serve >server.log 2>&1 &
    - |
      for i in $(seq 1 60); do
        curl -sf http://localhost:3000/index.html >/dev/null && break
        sleep 1
      done
      curl -sf http://localhost:3000/vue.html >/dev/null
    - npm run release:check
  artifacts:
    when: on_failure
    paths:
      - screenshots/
      - server.log
    expire_in: 1 week