Skip to content

Commit

Permalink
github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
stereobooster committed May 5, 2024
1 parent e8f38d3 commit fbf363a
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 52 deletions.
98 changes: 49 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# name: CI

# on:
# push:
# branches: ["main"]
# pull_request:
# types: [opened, synchronize]

# jobs:
# build:
# name: Build and Test
# timeout-minutes: 15
# runs-on: ubuntu-latest

# steps:
# - name: Check out code
# uses: actions/checkout@v4
# with:
# fetch-depth: 2

# - name: Cache turbo build setup
# uses: actions/cache@v3
# with:
# path: .turbo
# key: ${{ runner.os }}-turbo-${{ github.sha }}
# restore-keys: |
# ${{ runner.os }}-turbo-

# - uses: pnpm/action-setup@v3
# with:
# version: 8
# run_install: false

# - uses: actions/setup-node@v4
# with:
# node-version: 18
# cache: "pnpm"

# - name: Install dependencies
# run: pnpm install

# - name: Install Playwright Browsers
# run: pnpm exec playwright install chromium

# - name: Build
# run: pnpm build

# - name: Test
# run: pnpm test
name: CI

on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]

jobs:
build:
name: Build and Test
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: pnpm/action-setup@v3
with:
version: 8
run_install: false

- uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Install Playwright Browsers
run: pnpm exec playwright install chromium

- name: Build
run: pnpm build --cache-dir=.turbo

- name: Test
run: pnpm test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"author": "stereobooster",
"license": "MIT",
"private": true,
"type": "module",
"workspaces": [
"packages/*"
],
Expand Down
2 changes: 1 addition & 1 deletion packages/rehype-mermaid/test/fixtures/a.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<figure class="beoe mermaid"><svg aria-roledescription="flowchart-v2" role="graphics-document document" viewBox="-8 -8 43.453125 49.5" style="max-width: 43.453125px;" xmlns="http://www.w3.org/2000/svg" width="100%" id="m01-0"><style>#m01-0{font-family:arial,sans-serif;font-size:16px;fill:#333;}#m01-0 .error-icon{fill:#552222;}#m01-0 .error-text{fill:#552222;stroke:#552222;}#m01-0 .edge-thickness-normal{stroke-width:2px;}#m01-0 .edge-thickness-thick{stroke-width:3.5px;}#m01-0 .edge-pattern-solid{stroke-dasharray:0;}#m01-0 .edge-pattern-dashed{stroke-dasharray:3;}#m01-0 .edge-pattern-dotted{stroke-dasharray:2;}#m01-0 .marker{fill:#333333;stroke:#333333;}#m01-0 .marker.cross{stroke:#333333;}#m01-0 svg{font-family:arial,sans-serif;font-size:16px;}#m01-0 .label{font-family:arial,sans-serif;color:#333;}#m01-0 .cluster-label text{fill:#333;}#m01-0 .cluster-label span,#m01-0 p{color:#333;}#m01-0 .label text,#m01-0 span,#m01-0 p{fill:#333;color:#333;}#m01-0 .node rect,#m01-0 .node circle,#m01-0 .node ellipse,#m01-0 .node polygon,#m01-0 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#m01-0 .flowchart-label text{text-anchor:middle;}#m01-0 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#m01-0 .node .label{text-align:center;}#m01-0 .node.clickable{cursor:pointer;}#m01-0 .arrowheadPath{fill:#333333;}#m01-0 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#m01-0 .flowchart-link{stroke:#333333;fill:none;}#m01-0 .edgeLabel{background-color:#e8e8e8;text-align:center;}#m01-0 .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#m01-0 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#m01-0 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#m01-0 .cluster text{fill:#333;}#m01-0 .cluster span,#m01-0 p{color:#333;}#m01-0 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#m01-0 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#m01-0 :root{--mermaid-font-family:arial,sans-serif;}</style><g><marker orient="auto" markerHeight="12" markerWidth="12" markerUnits="userSpaceOnUse" refY="5" refX="6" viewBox="0 0 10 10" class="marker flowchart" id="m01-0_flowchart-pointEnd"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 0 L 10 5 L 0 10 z"></path></marker><marker orient="auto" markerHeight="12" markerWidth="12" markerUnits="userSpaceOnUse" refY="5" refX="4.5" viewBox="0 0 10 10" class="marker flowchart" id="m01-0_flowchart-pointStart"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 5 L 10 10 L 10 0 z"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="11" viewBox="0 0 10 10" class="marker flowchart" id="m01-0_flowchart-circleEnd"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="-1" viewBox="0 0 10 10" class="marker flowchart" id="m01-0_flowchart-circleStart"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="12" viewBox="0 0 11 11" class="marker cross flowchart" id="m01-0_flowchart-crossEnd"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="-1" viewBox="0 0 11 11" class="marker cross flowchart" id="m01-0_flowchart-crossStart"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><g class="root"><g class="clusters"></g><g class="edgePaths"></g><g class="edgeLabels"></g><g class="nodes"><g transform="translate(13.7265625, 16.75)" data-id="id" data-node="true" id="flowchart-id-0" class="node default default flowchart-label"><rect height="33.5" width="27.453125" y="-16.75" x="-13.7265625" ry="0" rx="0" style="" class="basic label-container"></rect><g transform="translate(-6.2265625, -9.25)" style="" class="label"><rect></rect><foreignObject height="18.5" width="12.453125"><div style="display: inline-block; white-space: nowrap;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel">id</span></div></foreignObject></g></g></g></g></g></svg></figure>
<figure class="beoe mermaid"><svg aria-roledescription="flowchart-v2" role="graphics-document document" viewBox="-8 -8 41.671875 49" style="max-width: 41.671875px;" xmlns="http://www.w3.org/2000/svg" width="100%" id="m01-0"><style>#m01-0{font-family:arial,sans-serif;font-size:16px;fill:#333;}#m01-0 .error-icon{fill:#552222;}#m01-0 .error-text{fill:#552222;stroke:#552222;}#m01-0 .edge-thickness-normal{stroke-width:2px;}#m01-0 .edge-thickness-thick{stroke-width:3.5px;}#m01-0 .edge-pattern-solid{stroke-dasharray:0;}#m01-0 .edge-pattern-dashed{stroke-dasharray:3;}#m01-0 .edge-pattern-dotted{stroke-dasharray:2;}#m01-0 .marker{fill:#333333;stroke:#333333;}#m01-0 .marker.cross{stroke:#333333;}#m01-0 svg{font-family:arial,sans-serif;font-size:16px;}#m01-0 .label{font-family:arial,sans-serif;color:#333;}#m01-0 .cluster-label text{fill:#333;}#m01-0 .cluster-label span,#m01-0 p{color:#333;}#m01-0 .label text,#m01-0 span,#m01-0 p{fill:#333;color:#333;}#m01-0 .node rect,#m01-0 .node circle,#m01-0 .node ellipse,#m01-0 .node polygon,#m01-0 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#m01-0 .flowchart-label text{text-anchor:middle;}#m01-0 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#m01-0 .node .label{text-align:center;}#m01-0 .node.clickable{cursor:pointer;}#m01-0 .arrowheadPath{fill:#333333;}#m01-0 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#m01-0 .flowchart-link{stroke:#333333;fill:none;}#m01-0 .edgeLabel{background-color:#e8e8e8;text-align:center;}#m01-0 .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#m01-0 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#m01-0 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#m01-0 .cluster text{fill:#333;}#m01-0 .cluster span,#m01-0 p{color:#333;}#m01-0 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#m01-0 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#m01-0 :root{--mermaid-font-family:arial,sans-serif;}</style><g><marker orient="auto" markerHeight="12" markerWidth="12" markerUnits="userSpaceOnUse" refY="5" refX="6" viewBox="0 0 10 10" class="marker flowchart" id="m01-0_flowchart-pointEnd"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 0 L 10 5 L 0 10 z"></path></marker><marker orient="auto" markerHeight="12" markerWidth="12" markerUnits="userSpaceOnUse" refY="5" refX="4.5" viewBox="0 0 10 10" class="marker flowchart" id="m01-0_flowchart-pointStart"><path style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 0 5 L 10 10 L 10 0 z"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="11" viewBox="0 0 10 10" class="marker flowchart" id="m01-0_flowchart-circleEnd"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5" refX="-1" viewBox="0 0 10 10" class="marker flowchart" id="m01-0_flowchart-circleStart"><circle style="stroke-width: 1; stroke-dasharray: 1, 0;" class="arrowMarkerPath" r="5" cy="5" cx="5"></circle></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="12" viewBox="0 0 11 11" class="marker cross flowchart" id="m01-0_flowchart-crossEnd"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><marker orient="auto" markerHeight="11" markerWidth="11" markerUnits="userSpaceOnUse" refY="5.2" refX="-1" viewBox="0 0 11 11" class="marker cross flowchart" id="m01-0_flowchart-crossStart"><path style="stroke-width: 2; stroke-dasharray: 1, 0;" class="arrowMarkerPath" d="M 1,1 l 9,9 M 10,1 l -9,9"></path></marker><g class="root"><g class="clusters"></g><g class="edgePaths"></g><g class="edgeLabels"></g><g class="nodes"><g transform="translate(12.8359375, 16.75)" data-id="A" data-node="true" id="flowchart-A-0" class="node default default flowchart-label"><rect height="33.5" width="25.671875" y="-16.75" x="-12.8359375" ry="0" rx="0" style="" class="basic label-container"></rect><g transform="translate(-5.3359375, -9.25)" style="" class="label"><rect></rect><foreignObject height="18.5" width="10.671875"><div style="display: inline-block; white-space: nowrap;" xmlns="http://www.w3.org/1999/xhtml"><span class="nodeLabel">A</span></div></foreignObject></g></g></g></g></g></svg></figure>
3 changes: 1 addition & 2 deletions packages/rehype-mermaid/test/fixtures/a.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
```mermaid
flowchart LR
id
graph TD; A;
```
1 change: 1 addition & 0 deletions packages/rehype-mermaid/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ it("renders diagram", async () => {
.use(rehypeStringify)
.process(await fs.readFile(new URL("./fixtures/a.md", import.meta.url)));

console.log(file.toString());
expect(file.toString()).toMatchFileSnapshot("./fixtures/a.html");
});

0 comments on commit fbf363a

Please sign in to comment.