chore: migrate to gh actions (#1775)

* chore: migrate to gh actions

* chore: update baselines

* chore: remove circle
This commit is contained in:
Tobias Åström
2025-06-24 12:52:16 +02:00
committed by GitHub
parent 388730565e
commit c64558bc76
67 changed files with 167 additions and 265 deletions

View File

@@ -1,265 +0,0 @@
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"
(cd apis/stardust && yarn link)
(cd commands/cli && yarn link)
(cd commands/build && yarn link)
(cd commands/serve && yarn link)
cd << parameters.project_name >>
yarn link "@nebula.js/stardust"
yarn link "@nebula.js/cli"
yarn link "@nebula.js/cli-build"
yarn link "@nebula.js/cli-serve"
echo "Log node_modules/@nebula.js"
ls -la node_modules/@nebula.js
<<# parameters.build >> yarn run build <</ parameters.build >>
<<# parameters.test >> yarn run test:e2e <</ parameters.test >>
jobs:
validate:
docker:
- image: cimg/node:24.2.0
working_directory: ~/project
steps:
- attach_workspace:
at: ~/project
- run:
name: Locale
command: yarn run locale:verify
- run:
name: Lint
command: yarn run lint
- run:
name: Run unit tests and publish to codeclimate
command: |
./test/bin/cc-test-reporter before-build
yarn test:unit --coverage --reporters=default --reporters=jest-junit
./test/bin/cc-test-reporter after-build --coverage-input-type lcov --exit-code $?
environment:
JEST_JUNIT_OUTPUT_DIR: ./coverage/junit/
- store_test_results:
path: coverage/junit
build:
docker:
- image: cimg/node:24.2.0
working_directory: ~/project
resource_class: large
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
- store_artifacts:
path: package.json
- persist_to_workspace:
root: ~/project
paths:
- .
test-integration:
docker:
- image: cimg/node:24.2.0
- image: browserless/chrome:1-puppeteer-7.1.0
working_directory: ~/project
resource_class: large
steps:
- attach_workspace:
at: ~/project
- run:
name: Install Playwright Browsers
command: npx playwright install --with-deps
- run:
name: Test component
command: yarn run test:component
- run:
name: Test mashup
command: yarn run test:mashup
- store_artifacts:
path: ./test/mashup
- run:
name: Test integration
command: yarn run test:integration
- run:
name: Test rendering
command: yarn run test:rendering
- store_artifacts:
path: ./test/rendering
test-create:
docker:
- image: cimg/node:24.2.0
- image: browserless/chrome:1-puppeteer-7.1.0
working_directory: ~/project
resource_class: large
steps:
- attach_workspace:
at: ~/project
- run: npx playwright install --with-deps chromium
- 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:
- attach_workspace:
at: ~/project
- run:
name: Create version.txt
command: |
set -x
if [ -n "${CIRCLE_TAG}" ]; then
version=${CIRCLE_TAG#v}
else
yarn workspace "@nebula.js/stardust" version --prepatch --no-git-tag-version
version=$(node -p "require('./apis/stardust/api-spec/spec.json').info.version")
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
docker cp ./apis/stardust/api-spec/listbox-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,ba0bcf91-d7a6-4048-a36a-ad9a2dc8c03e@/specs/listbox-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.*/
- validate:
requires:
- build
- test-integration:
requires:
- build
- test-create:
requires:
- build
- api-governance:
context: api-compliance
requires:
- build
filters:
branches:
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
ignore: /pull\/[0-9]+/
tags:
only:
- /v.*/

38
.github/scripts/nebula_create.sh vendored Normal file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -e
PROJECT_NAME="$1"
PICASSO_TEMPLATE="${2:-none}"
MASHUP="${3:-false}"
INSTALL="${4:-false}"
BUILD="${5:-true}"
TEST="${6:-true}"
if [ "$MASHUP" = "true" ]; then
echo "Create mashup project"
./commands/cli/lib/index.js create mashup "$PROJECT_NAME" --install "$INSTALL" --pkgm yarn
else
echo "Create project based on Picasso template"
./commands/cli/lib/index.js create "$PROJECT_NAME" --picasso "$PICASSO_TEMPLATE" --install "$INSTALL" --pkgm yarn
fi
echo "Yarn"
yarn
echo "Linking packages"
(cd apis/stardust && yarn link)
(cd commands/cli && yarn link)
(cd commands/build && yarn link)
(cd commands/serve && yarn link)
cd "$PROJECT_NAME"
yarn link "@nebula.js/stardust"
yarn link "@nebula.js/cli"
yarn link "@nebula.js/cli-build"
yarn link "@nebula.js/cli-serve"
echo "Log node_modules/@nebula.js"
ls -la node_modules/@nebula.js
if [ "$BUILD" = "true" ]; then
yarn run build
fi
if [ "$TEST" = "true" ]; then
yarn run test:e2e
fi

129
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,129 @@
name: CI
on:
push:
branches: [master]
tags: ['v*']
pull_request:
env:
JEST_JUNIT_OUTPUT_DIR: ./coverage/junit/
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24.x
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn run build
- name: Upload workspace
uses: actions/upload-artifact@v4
with:
name: workspace
path: .
retention-days: 1
validate:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
path: .
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Locale verify
run: yarn run locale:verify
- name: Lint
run: yarn run lint
- name: Run unit tests and publish to codeclimate
env:
JEST_JUNIT_OUTPUT_DIR: ./coverage/junit/
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
./test/bin/cc-test-reporter before-build
yarn test:unit --coverage --reporters=default --reporters=jest-junit
./test/bin/cc-test-reporter after-build --coverage-input-type lcov --exit-code $?
- name: Store junit results
uses: actions/upload-artifact@v4
with:
name: junit
path: coverage/junit
test-integration:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
path: .
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Test component
run: yarn run test:component
- name: Test mashup
run: yarn run test:mashup
- name: Store mashup artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: mashup
path: ./test/mashup
- name: Test integration
run: yarn run test:integration
- name: Test rendering
run: yarn run test:rendering
- name: Store rendering artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: rendering
path: ./test/rendering
test-create:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
path: .
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium
- run: chmod +x .github/scripts/nebula_create.sh
- name: Create Nebula visualization project (Picasso)
run: .github/scripts/nebula_create.sh generated/hello none false false true true
- name: Create Nebula visualization project (Barchart)
run: .github/scripts/nebula_create.sh generated/barchart barchart false false true true
- name: Create Nebula mashup project
run: .github/scripts/nebula_create.sh hello-mashup none true true true false
- name: Store barchart screenshots
if: always()
uses: actions/upload-artifact@v4
with:
name: barchart-screenshots
path: generated/barchart/screenshots
- name: Store mashup artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: mashup-artifacts
path: test/mashup/__artifacts__

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 14 KiB