From 5c8fda3891427993cba4d383e40afb83b63304b3 Mon Sep 17 00:00:00 2001 From: Alois Klink Date: Sat, 17 Sep 2022 22:27:49 +0100 Subject: [PATCH 1/2] ci(e2e-applitols): add applitools CI action Adds a [`workflow_dispatch`][1] GitHub Actions CI workflow that performs an E2E Cypress rendering test with Applitools integration. If the APPLITOOLS_API_KEY secret is not set, this action fallsback to just doing a normal E2E Cypress test without Applitools support. [1]: https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow --- .github/workflows/e2e-applitools.yml | 73 ++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/e2e-applitools.yml diff --git a/.github/workflows/e2e-applitools.yml b/.github/workflows/e2e-applitools.yml new file mode 100644 index 000000000..b0319b072 --- /dev/null +++ b/.github/workflows/e2e-applitools.yml @@ -0,0 +1,73 @@ +name: E2E (Applitools) + +on: + workflow_dispatch: + # Because we want to limit Applitools usage, so we only want to start this + # workflow on rare occasions/manually. + inputs: + parent_branch: + required: true + type: string + default: master + description: 'Parent branch to use for PRs' + +permissions: + contents: read + +env: + # on PRs from forks, this secret will always be empty, for security reasons + USE_APPLI: ${{ secrets.APPLITOOLS_API_KEY && 'true' || '' }} + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + steps: + - if: ${{ ! env.USE_APPLI }} + name: Warn if not using Applitools + run: | + echo "::error,title=Not using Applitols::APPLITOOLS_API_KEY is empty, disabling Applitools for this run." + - uses: actions/checkout@v3 + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + cache: yarn + node-version: ${{ matrix.node-version }} + + - name: Install Yarn + run: npm i yarn --global + + - name: Install Packages + run: | + yarn install --frozen-lockfile + env: + CYPRESS_CACHE_FOLDER: .cache/Cypress + + - name: Run Build + run: yarn build + + - if: ${{ env.USE_APPLI }} + name: Notify applitools of new batch + # Copied from docs https://applitools.com/docs/topics/integrations/github-integration-ci-setup.html + run: curl -L -d '' -X POST "$APPLITOOLS_SERVER_URL/api/externals/github/push?apiKey=$APPLITOOLS_API_KEY&CommitSha=$GITHUB_SHA&BranchName=${APPLITOOLS_BRANCH}$&ParentBranchName=$APPLITOOLS_PARENT_BRANCH" + env: + # e.g. mermaid-js/mermaid/my-branch + APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }} + APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }} + APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} + APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com' + + - name: Run E2E Tests + run: yarn e2e + env: + CYPRESS_CACHE_FOLDER: .cache/Cypress + # Mermaid applitools.config.js uses this to pick batch name. + APPLI_BRANCH: ${{ github.ref_name }} + APPLITOOLS_BATCH_ID: ${{ github.sha }} + # e.g. mermaid-js/mermaid/my-branch + APPLITOOLS_BRANCH: ${{ github.repository }}/${{ github.ref_name }} + APPLITOOLS_PARENT_BRANCH: ${{ github.inputs.parent_branch }} + APPLITOOLS_API_KEY: ${{ secrets.APPLITOOLS_API_KEY }} + APPLITOOLS_SERVER_URL: 'https://eyesapi.applitools.com' From b72dad9c5b4dcce79e1d7f4bc7fef76e985f15e8 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Tue, 20 Sep 2022 22:23:59 +0530 Subject: [PATCH 2/2] Revert #3475 Was an accidental merge. --- docs/classDiagram.md | 17 +++++++++++++++-- docs/gitgraph.md | 38 -------------------------------------- docs/index.html | 1 + 3 files changed, 16 insertions(+), 40 deletions(-) diff --git a/docs/classDiagram.md b/docs/classDiagram.md index 6c9ae96fe..3f12dddf8 100644 --- a/docs/classDiagram.md +++ b/docs/classDiagram.md @@ -660,14 +660,27 @@ It is also possible to attach a class to a list of nodes in one statement: A shorter form of adding a class is to attach the classname to the node using the `:::` operator: -```mmd +```mermaid-example +classDiagram + class Animal:::cssClass +``` + +```mermaid classDiagram class Animal:::cssClass ``` Or: -```mmd +```mermaid-example +classDiagram + class Animal:::cssClass { + -int sizeInFeet + -canEat() + } +``` + +```mermaid classDiagram class Animal:::cssClass { -int sizeInFeet diff --git a/docs/gitgraph.md b/docs/gitgraph.md index 863681085..5f86cf53c 100644 --- a/docs/gitgraph.md +++ b/docs/gitgraph.md @@ -393,44 +393,6 @@ Let see an example: commit id:"C" ``` -By default, the cherry-picked commit from commit with id `A` will be labeled `cherry-pick:A`. You can provide your own custom tag instead to override this behavior, using the same syntax as the `commit` keyword: - -```mermaid-example - gitGraph - commit id: "ZERO" - branch develop - commit id:"A" - checkout main - commit id:"ONE" - checkout develop - commit id:"B" - checkout main - commit id:"TWO" - cherry-pick id:"A" tag:"fix" - commit id:"THREE" - checkout develop - commit id:"C" -``` - -```mermaid - gitGraph - commit id: "ZERO" - branch develop - commit id:"A" - checkout main - commit id:"ONE" - checkout develop - commit id:"B" - checkout main - commit id:"TWO" - cherry-pick id:"A" tag:"fix" - commit id:"THREE" - checkout develop - commit id:"C" -``` - -To suppress the tag entirely, use `tag:""` (empty string). - ## Gitgraph specific configuration options In Mermaid, you have the option to configure the gitgraph diagram. You can configure the following options: diff --git a/docs/index.html b/docs/index.html index 22892d60b..0a41b516c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,6 +15,7 @@ name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" /> +