Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: npm

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-ghes-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: npm

- name: Install dependencies
Expand Down
136 changes: 136 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
stages:
- check
- build
- deploy

variables:
CI: "true"

# ─── MR checks ───────────────────────────────────────────────────────────────

jira-ticket-check:
stage: check
image: alpine:latest
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- |
title="$CI_MERGE_REQUEST_TITLE"
echo "Checking Merge Request title: $title"
if echo "$title" | grep -qiE '[A-Za-z]{2,6}-[0-9]+[[:space:]]+#done'; then
echo "Title contains a Jira ticket with '#done'"
exit 0
elif echo "$title" | grep -q '#noJiraCheck'; then
echo "Check disabled by #noJiraCheck"
exit 0
else
echo "ERROR: Title does not contain a Jira ticket with '#done'"
echo "Add #noJiraCheck to the title to bypass this check."
exit 1
fi

# ─── Node.js CI ──────────────────────────────────────────────────────────────

.node-ci:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script:
- npm ci
- npm run buildcore --if-present
- npm run buildcomponents --if-present
- npm run test components -- --watch=false
- npm run buildanalytics --if-present
- npm run buildhellosearch --if-present
- npm run buildvanilla --if-present
- npm run buildpepper --if-present

node-ci-node10:
extends: .node-ci
image: node:10

node-ci-node12:
extends: .node-ci
image: node:12

# ─── Docs: test build on MR to master ────────────────────────────────────────

test-docs-build:
stage: build
image: node:18
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script:
- npm run docs:ci
- npm run docs:build

# ─── Docs: Docusaurus → GitLab Pages (public) ────────────────────────────────
# GitLab Pages requires the job to be named "pages" and artifact path "public".

pages:
stage: deploy
image: node:18
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- when: manual
script:
- npm run docs:ci
- npm run docs:build
- mv ./docusaurus/build public
artifacts:
paths:
- public

# ─── Docs: Docusaurus → internal deployment (self-hosted runner) ─────────────

pages-internal:
stage: deploy
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- when: manual
script:
- npm run docs:ci
- npm run docs:build-internal
- mv ./docusaurus/build public
artifacts:
paths:
- public

# ─── Docs: Jekyll → GitLab Pages (public) ────────────────────────────────────

pages-jekyll:
stage: deploy
image: node:18
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- when: manual
before_script:
- apt-get update -qq && apt-get install -y ruby-full build-essential zlib1g-dev
- gem install bundler
- bundle install --gemfile=docs/Gemfile
script:
- node ./scripts/doc-preprocess.js https://github.com/sinequa/sba-angular
- npm ci
- npm run builddocs
- BUNDLE_GEMFILE=docs/Gemfile bundle exec jekyll build --source ./docs --destination ./public
artifacts:
paths:
- public

# ─── Docs: Jekyll → internal deployment (self-hosted runner) ─────────────────

pages-jekyll-internal:
stage: deploy
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- when: manual
script:
- node ./scripts/doc-replace-baseurl.js
- node ./scripts/doc-preprocess.js https://github.sinequa.com/CustomerSolutions/sba-internal
- npm ci
- npm run builddocs
- bundle exec jekyll build --source ./docs --destination ./public
artifacts:
paths:
- public
122 changes: 54 additions & 68 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,28 @@
}
}
},
"build-test": {
"builder": "@angular/build:application",
"options": {
"tsConfig": "projects/core/tsconfig.spec.json",
"polyfills": [
"zone.js"
],
"inlineStyleLanguage": "scss"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular/build:unit-test",
"options": {
"polyfills": ["zone.js","zone.js/testing"],
"inlineStyleLanguage": "scss",
"runner": "vitest",
"buildTarget": "core:build-test",
"tsConfig": "projects/core/tsconfig.spec.json",
"include": [
"projects/core/**/*.spec.ts"
],
"tsConfig": "projects/core/tsconfig.spec.json",
"karmaConfig": "projects/core/karma.conf.js"
"setupFiles": [
"test-setup.ts"
]
}
},
"lint": {
Expand Down Expand Up @@ -62,18 +74,29 @@
}
}
},
"build-test": {
"builder": "@angular/build:application",
"options": {
"tsConfig": "projects/components/tsconfig.spec.json",
"polyfills": [
"zone.js"
],
"inlineStyleLanguage": "scss"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular/build:unit-test",
"options": {
"polyfills": ["zone.js","zone.js/testing"],
"inlineStyleLanguage": "scss",
"runner": "vitest",
"buildTarget": "components:build-test",
"tsConfig": "projects/components/tsconfig.spec.json",
"include": [
"projects/components/**/*.spec.ts",
"projects/components/__tests__/*.spec.ts"

],
"tsConfig": "projects/components/tsconfig.spec.json",
"karmaConfig": "projects/components/karma.conf.js"
"setupFiles": [
"test-setup.ts"
]
}
},
"lint": {
Expand Down Expand Up @@ -104,7 +127,9 @@
"outputPath": "dist/hello-search",
"index": "projects/hello-search/src/index.html",
"browser": "projects/hello-search/src/main.ts",
"polyfills": ["projects/hello-search/src/polyfills.ts"],
"polyfills": [
"projects/hello-search/src/polyfills.ts"
],
"tsConfig": "projects/hello-search/tsconfig.json",
"preserveSymlinks": true,
"assets": [
Expand Down Expand Up @@ -201,23 +226,6 @@
"buildTarget": "hello-search:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/hello-search/src/test.ts",
"polyfills": "projects/hello-search/src/polyfills.ts",
"tsConfig": "projects/hello-search/tsconfig.spec.json",
"karmaConfig": "projects/hello-search/karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"projects/hello-search/src/assets"
],
"styles": [
"projects/hello-search/src/styles/app.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
Expand Down Expand Up @@ -351,23 +359,6 @@
"buildTarget": "vanilla-search:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/vanilla-search/src/test.ts",
"polyfills": "projects/vanilla-search/src/polyfills.ts",
"tsConfig": "projects/vanilla-search/tsconfig.spec.json",
"karmaConfig": "projects/vanilla-search/karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"projects/vanilla-search/src/assets"
],
"styles": [
"projects/vanilla-search/src/styles/app.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
Expand Down Expand Up @@ -513,23 +504,6 @@
"buildTarget": "pepper:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/pepper/src/test.ts",
"polyfills": "projects/pepper/src/polyfills.ts",
"tsConfig": "projects/pepper/tsconfig.spec.json",
"karmaConfig": "projects/pepper/karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"projects/pepper/src/assets"
],
"styles": [
"projects/pepper/src/styles/app.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
Expand Down Expand Up @@ -559,16 +533,28 @@
}
}
},
"build-test": {
"builder": "@angular/build:application",
"options": {
"tsConfig": "projects/analytics/tsconfig.spec.json",
"polyfills": [
"zone.js"
],
"inlineStyleLanguage": "scss"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular/build:unit-test",
"options": {
"polyfills": ["zone.js","zone.js/testing"],
"inlineStyleLanguage": "scss",
"runner": "vitest",
"buildTarget": "analytics:build-test",
"tsConfig": "projects/analytics/tsconfig.spec.json",
"include": [
"projects/analytics/**/*.spec.ts"
],
"tsConfig": "projects/analytics/tsconfig.spec.json",
"karmaConfig": "projects/analytics/karma.conf.js"
"setupFiles": [
"test-setup.ts"
]
}
},
"lint": {
Expand Down
16 changes: 15 additions & 1 deletion docusaurus/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,21 @@ const config: Config = {
locales: ['en'],
},

plugins: [require.resolve('docusaurus-lunr-search')],
themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
{
hashed: true,
indexDocs: true,
indexBlog: false,
indexPages: true,
// The classic preset serves the docs at the site root (docs.routeBasePath: '/'),
// so the default '/docs' would produce broken result links.
docsRouteBasePath: '/',
highlightSearchTermsOnTargetPage: true,
},
],
],

markdown: {
mdx1Compat: {
Expand Down
16 changes: 15 additions & 1 deletion docusaurus/docusaurus.internal.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,21 @@ const config: Config = {
locales: ['en'],
},

plugins: [require.resolve('docusaurus-lunr-search')],
themes: [
[
require.resolve('@easyops-cn/docusaurus-search-local'),
{
hashed: true,
indexDocs: true,
indexBlog: false,
indexPages: true,
// The classic preset serves the docs at the site root (docs.routeBasePath: '/'),
// so the default '/docs' would produce broken result links.
docsRouteBasePath: '/',
highlightSearchTermsOnTargetPage: true,
},
],
],

markdown: {
mdx1Compat: {
Expand Down
Loading
Loading