Files
nebula.js/.circleci/config.yml
Tobias Åström 3dacac587b feat: sheet embed support (#1013)
* feat: add basic sheet rendering support

* chore: add missing file

* fix: correct bg colors for none support

* chore: fix test that relied on dark bg

* chore: fix ref

* chore: api spec update

* chore: add todo comments

* chore: use memo

* chore: a bit less verbose

* chore: list

* chore: cleaning

* chore: add rendering test

* chore: enable rendering test

* chore: settings

* chore: settings

* chore: disable rendering tests

* chore: revert test tests
2022-12-12 13:54:04 +01:00

207 lines
6.4 KiB
YAML

version: 2.1
aliases:
- &restore_yarn_cache
name: Restore yarn cache
keys:
- yarn-packages-v2-{{ checksum "yarn.lock" }}
- &save_yarn_cache
name: Save yarn cache
paths:
- ~/.cache/yarn
- ./node_modules
- ./apis/locale/node_modules
- ./apis/stardust/node_modules
- ./apis/nucleus/node_modules
- ./commands/sense/node_modules
- ./commands/build/node_modules
- ./commands/serve/node_modules
- ./commands/create/node_modules
key: yarn-packages-v2-{{ checksum "yarn.lock" }}
- &filter_master
branches:
only: master
- &attach
at: ~/project
commands:
nebula_create:
description: 'Create Nebula visualization project'
parameters:
project_name:
type: string
description: 'Project name'
picasso_template:
type: string
description: 'Picasso template'
default: 'none'
mashup:
type: boolean
default: false
install:
type: boolean
default: false
description: 'Run package installation step'
build:
type: boolean
default: true
description: 'Build project'
test:
type: boolean
default: true
description: 'Run tests'
steps:
- run:
name: 'Create Nebula visualization project: <<# parameters.mashup >>Mashup<</ parameters.mashup >><<^ parameters.mashup >>Picasso template "<< parameters.picasso_template >>" <</ parameters.mashup >> in << parameters.project_name >>'
command: |
set -e
<<# parameters.mashup >>
echo "Create mashup project"
./commands/cli/lib/index.js create mashup << parameters.project_name >> --install << parameters.install >> --pkgm yarn
<</ parameters.mashup >>
<<^ parameters.mashup >>
echo "Create project based on Picasso template"
./commands/cli/lib/index.js create << parameters.project_name >> --picasso << parameters.picasso_template >> --install << parameters.install >> --pkgm yarn
<</ parameters.mashup >>
echo "Yarn"
yarn
echo "Linking packages"
npx lerna link --force-local
cd << parameters.project_name >>
echo "Log node_modules/@nebula.js"
ls -la node_modules/@nebula.js
npx playwright install
npx playwright install chrome
<<# parameters.build >> yarn run build <</ parameters.build >>
<<# parameters.test >> yarn run test:e2e <</ parameters.test >>
jobs:
build:
docker:
- image: cimg/node:18.12.1
- image: browserless/chrome:1-puppeteer-7.1.0
working_directory: ~/project
steps:
- checkout
- restore_cache: *restore_yarn_cache
- run:
name: Install dependencies
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
- save_cache: *save_yarn_cache
- run:
name: Build
command: yarn run build
- run:
name: Lint
command: yarn run lint
- run:
name: Locale
command: yarn run locale:verify
- run:
name: Unit Tests
command: |
yarn test:unit --coverage
if [ ! -z "$COVERALLS_REPO_TOKEN" ]; then
echo "Uploading coverage results to coveralls.io..."
cat ./coverage/lcov.info | npx coveralls
fi
- store_test_results:
path: coverage/junit
# - run:
# name: Test rendering
# command: yarn run test:rendering
- run:
name: Test component
command: yarn run test:component --chrome.browserWSEndpoint "ws://localhost:3000" --no-launch
- run:
name: Test mashup
command: yarn run test:mashup --chrome.browserWSEndpoint "ws://localhost:3000" --no-launch
- run:
name: Test integration
command: yarn run test:integration --chrome.browserWSEndpoint "ws://localhost:3000" --no-launch
- nebula_create:
project_name: 'generated/hello'
picasso_template: 'none'
build: true
test: true
- nebula_create:
project_name: generated/barchart
picasso_template: 'barchart'
build: true
test: true
- nebula_create:
project_name: 'hello-mashup'
mashup: true
install: true
build: true
test: false
- store_artifacts:
path: generated/barchart/screenshots
- store_artifacts:
path: test/mashup/__artifacts__
api-governance:
machine:
image: ubuntu-2004:current
working_directory: ~/project
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: Create version.txt
command: |
set -x
if [ -n "${CIRCLE_TAG}" ]; then
version=${CIRCLE_TAG#v}
else
version=$(git describe --tags --abbrev=7 --match "v*")
version=${version#v}
fi
echo "$version" > ./version.txt
echo "Building $version"
- run:
name: Prepare API Compliance
command: |
docker pull ghcr.io/qlik-download/api-compliance
docker create -v /specs --name specs alpine:3.4 /bin/true
docker cp ./apis/stardust/api-spec/spec.json specs:/specs
- run:
name: Run API Compliance
command: >
VER=v$(cat version.txt)
docker run --volumes-from specs
-e SPEC_PATHS="abdc47c2-921a-45d3-ba5c-80d448574c5b@/specs/spec.json"
-e COMMIT_SHA="$CIRCLE_SHA1"
-e RELEASE_TAG="$VER"
-e PRE_RELEASE="true"
-e CREDENTIALS_S3_SECRETKEY="$APICULTURIST_S3"
-e CREDENTIALS_GITHUB="$APICULTURIST_GITHUB"
-e CREDENTIALS_COLONY="$APICULTURIST_TOKEN"
ghcr.io/qlik-download/api-compliance
workflows:
version: 2
build-deploy:
jobs:
- build:
filters:
tags:
only:
- /v.*/
- api-governance:
context: api-compliance
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
ignore: /pull\/[0-9]+/
tags:
only:
- /v.*/