mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-11 10:09:39 +02:00
Merge branch 'aloisklink/3061_monorepo-e2e-tests' into 3061_making_a_monorepo
Fixes most CI actions to support pnpm and the mono-repo. It looks like there are some errors related to `mermaid-mindmap` not being able to find `mermaid` or `mermaid/diagramAPI`
This commit is contained in:
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@@ -20,26 +20,32 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
yarn install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Build
|
- name: Run Build
|
||||||
run: yarn build
|
run: pnpm run build
|
||||||
|
|
||||||
- name: Upload Build as Artifact
|
- name: Upload Mermaid Build as Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: mermaid-build
|
||||||
path: dist
|
path: packages/mermaid/dist
|
||||||
|
|
||||||
|
- name: Upload Mermaid Mindmap Build as Artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: mermaid-mindmap-build
|
||||||
|
path: packages/mermaid-mindmap/dist
|
||||||
|
17
.github/workflows/e2e-applitools.yml
vendored
17
.github/workflows/e2e-applitools.yml
vendored
@@ -29,25 +29,24 @@ jobs:
|
|||||||
name: Warn if not using Applitools
|
name: Warn if not using Applitools
|
||||||
run: |
|
run: |
|
||||||
echo "::error,title=Not using Applitols::APPLITOOLS_API_KEY is empty, disabling Applitools for this run."
|
echo "::error,title=Not using Applitols::APPLITOOLS_API_KEY is empty, disabling Applitools for this run."
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
yarn install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Build
|
|
||||||
run: yarn build
|
|
||||||
|
|
||||||
- if: ${{ env.USE_APPLI }}
|
- if: ${{ env.USE_APPLI }}
|
||||||
name: Notify applitools of new batch
|
name: Notify applitools of new batch
|
||||||
# Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html
|
# Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html
|
||||||
@@ -60,7 +59,7 @@ jobs:
|
|||||||
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
|
APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com'
|
||||||
|
|
||||||
- name: Run E2E Tests
|
- name: Run E2E Tests
|
||||||
run: yarn e2e
|
run: pnpm run e2e
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
# Mermaid applitools.config.js uses this to pick batch name.
|
# Mermaid applitools.config.js uses this to pick batch name.
|
||||||
|
18
.github/workflows/e2e.yml
vendored
18
.github/workflows/e2e.yml
vendored
@@ -16,29 +16,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- uses: pnpm/action-setup@v2
|
||||||
id: yarn-and-build-cache
|
# uses version from "packageManager" field in package.json
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cache/Cypress
|
|
||||||
build
|
|
||||||
node_modules
|
|
||||||
key: ${{ runner.os }}-node_modules-build-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-node_modules-build-
|
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
# Install NPM dependencies, cache them correctly
|
# Install NPM dependencies, cache them correctly
|
||||||
# and run all Cypress tests
|
# and run all Cypress tests
|
||||||
- name: Cypress run
|
- name: Cypress run
|
||||||
uses: cypress-io/github-action@v3
|
uses: cypress-io/github-action@v4
|
||||||
with:
|
with:
|
||||||
start: yarn dev
|
start: pnpm run dev
|
||||||
wait-on: 'http://localhost:9000'
|
wait-on: 'http://localhost:9000'
|
||||||
record: true
|
record: true
|
||||||
headless: true
|
headless: true
|
||||||
|
14
.github/workflows/lint.yml
vendored
14
.github/workflows/lint.yml
vendored
@@ -20,23 +20,23 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
yarn install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Linting
|
- name: Run Linting
|
||||||
run: yarn lint
|
run: pnpm run lint
|
||||||
|
|
||||||
- name: Verify Docs
|
- name: Verify Docs
|
||||||
run: yarn docs:verify
|
run: pnpm run docs:verify
|
||||||
|
12
.github/workflows/test.yml
vendored
12
.github/workflows/test.yml
vendored
@@ -14,24 +14,24 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
# uses version from "packageManager" field in package.json
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
cache: yarn
|
cache: pnpm
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install Yarn
|
|
||||||
run: npm i yarn --global
|
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
yarn install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
env:
|
env:
|
||||||
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
CYPRESS_CACHE_FOLDER: .cache/Cypress
|
||||||
|
|
||||||
- name: Run Unit Tests
|
- name: Run Unit Tests
|
||||||
run: |
|
run: |
|
||||||
yarn ci --coverage
|
pnpm run ci --coverage
|
||||||
|
|
||||||
- name: Upload Coverage to Coveralls
|
- name: Upload Coverage to Coveralls
|
||||||
# it feels a bit weird to use @master, but that's what the docs use
|
# it feels a bit weird to use @master, but that's what the docs use
|
||||||
|
@@ -2,3 +2,5 @@ dist
|
|||||||
cypress/platform/xss3.html
|
cypress/platform/xss3.html
|
||||||
.cache
|
.cache
|
||||||
coverage
|
coverage
|
||||||
|
# Autogenerated by PNPM
|
||||||
|
pnpm-lock.yaml
|
@@ -7,6 +7,7 @@
|
|||||||
"module": "dist/mermaid.core.mjs",
|
"module": "dist/mermaid.core.mjs",
|
||||||
"types": "dist/mermaid.d.ts",
|
"types": "dist/mermaid.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"packageManager": "pnpm@7.12.2",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"require": "./dist/mermaid.min.js",
|
"require": "./dist/mermaid.min.js",
|
||||||
@@ -31,13 +32,13 @@
|
|||||||
"build:watch": "pnpm build:code --watch",
|
"build:watch": "pnpm build:code --watch",
|
||||||
"build": "pnpm clean; concurrently \"pnpm build:vite\" \"pnpm build:types\"",
|
"build": "pnpm clean; concurrently \"pnpm build:vite\" \"pnpm build:types\"",
|
||||||
"dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server\"",
|
"dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server\"",
|
||||||
"docs:build": "ts-node-esm --transpileOnly src/docs.mts",
|
"docs:build": "ts-node-esm --transpileOnly packages/mermaid/src/docs.mts",
|
||||||
"docs:verify": "pnpm docs:build --verify",
|
"docs:verify": "pnpm docs:build --verify",
|
||||||
"todo-postbuild": "documentation build src/mermaidAPI.ts src/config.ts src/defaultConfig.ts --shallow -f md --markdown-toc false > src/docs/Setup.md && prettier --write src/docs/Setup.md",
|
"todo-postbuild": "documentation build src/mermaidAPI.ts src/config.ts src/defaultConfig.ts --shallow -f md --markdown-toc false > src/docs/Setup.md && prettier --write src/docs/Setup.md",
|
||||||
"release": "pnpm build",
|
"release": "pnpm build",
|
||||||
"lint": "eslint --cache --ignore-path .gitignore . && pnpm lint:jison && prettier --check .",
|
"lint": "eslint --cache --ignore-path .gitignore . && pnpm lint:jison && prettier --check .",
|
||||||
"lint:fix": "eslint --fix --ignore-path .gitignore . && prettier --write .",
|
"lint:fix": "eslint --fix --ignore-path .gitignore . && prettier --write .",
|
||||||
"lint:jison": "ts-node-esm --transpileOnly src/jison/lint.mts",
|
"lint:jison": "ts-node-esm --transpileOnly packages/mermaid/src/jison/lint.mts",
|
||||||
"cypress": "cypress run",
|
"cypress": "cypress run",
|
||||||
"cypress:open": "cypress open",
|
"cypress:open": "cypress open",
|
||||||
"e2e": "start-server-and-test dev http://localhost:9000/ cypress",
|
"e2e": "start-server-and-test dev http://localhost:9000/ cypress",
|
||||||
|
1389
pnpm-lock.yaml
generated
1389
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,8 @@ export default defineConfig({
|
|||||||
test: {
|
test: {
|
||||||
environment: 'jsdom',
|
environment: 'jsdom',
|
||||||
globals: true,
|
globals: true,
|
||||||
setupFiles: ['src/tests/setup.ts'],
|
// TODO: should we move this to a mermaid-core package?
|
||||||
|
setupFiles: ['packages/mermaid/src/tests/setup.ts'],
|
||||||
coverage: {
|
coverage: {
|
||||||
reporter: ['text', 'json', 'html', 'lcov'],
|
reporter: ['text', 'json', 'html', 'lcov'],
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user