-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e0501c
commit a83846a
Showing
280 changed files
with
5,137 additions
and
16,206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,286 @@ | ||
default: | ||
image: dockerhub.sisense.com/node:18.16.0 | ||
tags: | ||
- k8s | ||
|
||
# Just cache ".yarn/cache" and avoid caching "node_modules": | ||
# https://github.com/yarnpkg/berry/discussions/2621#discussioncomment-505872 | ||
cache: | ||
key: $CI_COMMIT_REF_NAME | ||
paths: | ||
- .yarn/cache | ||
|
||
before_script: | ||
- yarn --version | ||
# These directories _might_ be restored (not guaranteed) from a previously created cache. | ||
# | ||
# These directories are restored from a previous cache when this Job is running on a | ||
# GitLab Runner that has already has a cache for our configured cache key. | ||
# | ||
# For transparency, always print out how many subdirectories are in these directories, | ||
# so that it is obvious in the GitLab logs whether this Job ran with these files initially | ||
# restored from a cache or not. | ||
- '(ls .yarn/cache || true) | wc -l' | ||
|
||
# If there is an open MR, do not run the branch pipeline. Run the merge request | ||
# pipeline instead. | ||
# https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines | ||
workflow: | ||
rules: | ||
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS | ||
when: never | ||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" | ||
- if: $CI_COMMIT_BRANCH | ||
|
||
# The GL_RELEASE_BOT_USER_NAME value used below references the bot user created | ||
# with the project access token. | ||
# More on bot users/project access tokens: https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#bot-users-for-projects | ||
.configure_git: &configure_git |- | ||
echo 'Git client is being configured...' | ||
git remote set-url origin "https://${GL_RELEASE_BOT_USER_NAME}:${GITLAB_TOKEN}@gitlab.sisense.com/${CI_PROJECT_PATH}.git" | ||
git config user.name "${GL_RELEASE_BOT_USER_NAME}" | ||
git config user.email "${GL_RELEASE_BOT_USER_EMAIL}" | ||
git config --add push.pushOption ci.skip | ||
git fetch | ||
git checkout --force -B "${CI_COMMIT_BRANCH}" "origin/${CI_COMMIT_BRANCH}" | ||
git reset --hard | ||
git clean -fdx | ||
git status | ||
echo 'Git client is configured successfully' | ||
|
||
stages: | ||
- test | ||
- publish | ||
- external | ||
- security | ||
|
||
lint-commits: | ||
stage: test | ||
script: | ||
- yarn install --immutable | ||
- ./ci/lint_commits.sh | ||
rules: | ||
- if: $CI_COMMIT_AUTHOR == "svc_whitesource <[email protected]>" | ||
when: never | ||
- if: $CI_PIPELINE_SOURCE == "merge_request_event" | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
tags: | ||
- build-nodejs | ||
|
||
audit: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
script: | ||
- yarn npm audit --environment production | ||
tags: | ||
- build-nodejs | ||
|
||
unit-tests: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
script: | ||
- yarn install --immutable | ||
- yarn build:prod | ||
- yarn test:coverage:combine | ||
coverage: /^(?:Branches)\s*:\s*([^%]+)/ | ||
tags: | ||
- build-nodejs | ||
artifacts: | ||
reports: | ||
coverage_report: | ||
coverage_format: cobertura | ||
path: coverage/cobertura-coverage.xml | ||
|
||
component-tests: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
image: mcr.microsoft.com/playwright:v1.36.2-jammy | ||
script: | ||
- yarn install --immutable | ||
- yarn build:prod | ||
- yarn test:ct | ||
|
||
coverage: /^(?:Branches)\s*:\s*([^%]+)/ | ||
tags: | ||
- build-nodejs | ||
artifacts: | ||
when: always | ||
paths: | ||
- e2e/playwright-report/ | ||
- e2e/test-results/ | ||
- e2e/results.xml | ||
reports: | ||
junit: e2e/results.xml | ||
expire_in: 1 week | ||
|
||
report: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
needs: ['component-tests'] | ||
script: | ||
- mkdir -p public/$CI_PIPELINE_ID | ||
- mv e2e/playwright-report/* public/$CI_PIPELINE_ID/ | ||
- ls -l public | ||
artifacts: | ||
name: '$CI_PIPELINE_ID' | ||
when: always | ||
paths: | ||
- public | ||
expire_in: 1 week | ||
tags: | ||
- build-nodejs | ||
|
||
lint: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
script: | ||
- yarn install --immutable | ||
- yarn build:prod | ||
- yarn lint --quiet | ||
tags: | ||
- build-nodejs | ||
|
||
format:check: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
script: | ||
- yarn install --immutable | ||
- yarn format:check | ||
tags: | ||
- build-nodejs | ||
|
||
docs:check:md: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
script: | ||
- yarn install --immutable | ||
- yarn build:prod | ||
- yarn docs:gen:md | ||
- yarn docs:check:md | ||
tags: | ||
- build-nodejs | ||
|
||
compile-demo: | ||
stage: test | ||
rules: | ||
- if: $CI_COMMIT_BRANCH != "external-main" | ||
script: | ||
- yarn install --immutable | ||
- yarn build:prod | ||
- yarn workspace react-ts-demo tsc | ||
- yarn workspace angular-demo build | ||
- yarn workspace vue-ts-demo build | ||
tags: | ||
- build-nodejs | ||
|
||
version-and-publish-to-npm: | ||
stage: publish | ||
when: manual | ||
script: | ||
- *configure_git | ||
- yarn install --immutable | ||
- yarn config unset npmAuthToken | ||
- yarn version-and-publish "${BUMP_STRATEGY}" | ||
variables: | ||
BUMP_STRATEGY: patch | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "master" | ||
tags: | ||
- build-nodejs | ||
|
||
pages: | ||
stage: publish | ||
environment: staging | ||
script: | ||
- yarn install --immutable | ||
- yarn build:prod | ||
- yarn docs:gen | ||
- yarn workspace @sisense/sdk-ui build-storybook | ||
- rm -rf public | ||
- mv docs public | ||
- mv packages/sdk-ui/storybook-static public/storybook-static | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "master" | ||
changes: | ||
- tsdoc.json | ||
- typedoc.config.cjs | ||
- quickstart.md | ||
- quickstart-angular.md | ||
- packages/sdk-data/**/*.ts | ||
- packages/sdk-ui/**/*.{ts,tsx} | ||
when: on_success | ||
- if: $CI_COMMIT_BRANCH == "master" | ||
when: manual | ||
artifacts: | ||
paths: | ||
- public | ||
tags: | ||
- build-nodejs | ||
|
||
storybook-deploy-s3: | ||
variables: | ||
environment: staging | ||
stage: publish | ||
script: | ||
- yarn install --immutable | ||
- yarn build:prod | ||
- yarn workspace @sisense/sdk-ui build-storybook | ||
|
||
# Deployment to S3 | ||
- apt-get update && apt-get install -y awscli | ||
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID | ||
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY | ||
- aws s3 sync packages/sdk-ui/storybook-static/ s3://compose-sdk-internal-storybook --delete | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "master" | ||
tags: | ||
- build-nodejs | ||
|
||
push-to-github: | ||
stage: external | ||
when: manual | ||
script: | ||
- *configure_git | ||
- ./ci/sync-gitlab-to-github.sh | ||
variables: | ||
GITHUB_URL: [email protected]:sisense/compose-sdk-monorepo.git | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "external-main" | ||
tags: | ||
- build-nodejs | ||
|
||
prerelease: | ||
stage: publish | ||
when: manual | ||
script: | ||
- yarn install --immutable | ||
- yarn config set npmRegistryServer "https://artifactory.sisense.com/artifactory/api/npm/sisense-node-modules/" | ||
- yarn config set npmAuthIdent "${NPM_REGISTRY_AUTH_TOKEN}" | ||
- yarn workspaces foreach --since --recursive --no-private version prerelease --deferred | ||
- yarn version apply --all --prerelease="alpha-${CI_COMMIT_SHORT_SHA}" | ||
- yarn workspaces foreach --no-private --verbose --topological run build:prod | ||
- yarn workspaces foreach --since --no-private npm publish --tolerate-republish | ||
- echo 'The following prerelease versions have been published:' | ||
- yarn workspaces foreach --since --recursive --no-private exec node -p "require('./package.json').name + ' - ' + require('./package.json').version" | ||
except: | ||
- master | ||
tags: | ||
- build-nodejs | ||
|
||
security-code-scan: | ||
allow_failure: true | ||
stage: security | ||
variables: | ||
GIT_SSL_NO_VERIFY: 'true' | ||
PROJECT_KEY: composesdk | ||
before_script: | ||
- curl -sfL 'https://raw.githubusercontent.com/orcasecurity/orca-cli/main/install.sh' | sh | ||
script: | ||
- orca-cli -p "${PROJECT_KEY}" fs scan "${CI_PROJECT_DIR}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.