Skip to content

Commit 5391bb9

Browse files
test: migrate to playwright (#1576)
* refactor: migrate e2e to playwright * test: finish migration of all e2e tests * chore: f * chore: f * chore: f * chore: f * chore: re-enable prettier * chore: f * [autofix.ci] apply automated fixes * chore: f * chore: f * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 854eec5 commit 5391bb9

File tree

384 files changed

+7419
-5197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+7419
-5197
lines changed

Diff for: .changeset/config.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3-
"changelog": "@changesets/cli/changelog",
4-
"commit": false,
5-
"linked": [["@milkdown/*"]],
6-
"access": "public",
7-
"baseBranch": "main",
8-
"updateInternalDependencies": "patch",
9-
"ignore": [],
10-
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
11-
"onlyUpdatePeerDependentsWhenOutOfRange": true
12-
}
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"linked": [["@milkdown/*"]],
6+
"access": "public",
7+
"baseBranch": "main",
8+
"updateInternalDependencies": "patch",
9+
"ignore": [],
10+
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
11+
"onlyUpdatePeerDependentsWhenOutOfRange": true
12+
}
1313
}

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ We appreciate you spending the time to work on these changes.
55
⚠️ If you're adding a new plugin, please make sure you've already created issues or discussions where we have discussed about it. Currently we encourage you to publish your own community plugins. And we're very cautious about adding new official plugins.
66
-->
77

8-
- [ ] I read the contributing guide <!-- https://github.com/Saul-Mirone/milkdown/blob/main/CONTRIBUTING.md -->
9-
- [ ] I agree to follow the code of conduct <!-- https://github.com/Saul-Mirone/milkdown/blob/main/CODE_OF_CONDUCT.md -->
8+
- [ ] I read the contributing guide <!-- https://github.com/Saul-Mirone/milkdown/blob/main/CONTRIBUTING.md -->
9+
- [ ] I agree to follow the code of conduct <!-- https://github.com/Saul-Mirone/milkdown/blob/main/CODE_OF_CONDUCT.md -->
1010

1111
## Summary
1212

Diff for: .github/actions/setup/action.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Setup
2+
description: Setup the environment
3+
4+
inputs:
5+
node-version:
6+
description: The version of node.js
7+
required: false
8+
default: '20'
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- uses: pnpm/[email protected]
14+
with:
15+
run_install: false
16+
17+
- name: Setup node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ inputs.node-version }}
21+
cache: pnpm
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Install
25+
run: pnpm install
26+
shell: bash
27+
28+
- name: Build packages
29+
run: pnpm build
30+
shell: bash

Diff for: .github/workflows/ci-for-pr.yml

-75
This file was deleted.

Diff for: .github/workflows/ci.yml

+16-45
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,50 @@
1-
name: On Push
1+
name: ci
22

33
on:
44
push:
5-
branches: main
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
68

79
env:
810
CI: true
9-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
1011

1112
jobs:
12-
build-test-release:
13+
build-and-test:
1314
runs-on: ubuntu-latest
1415
steps:
1516
- name: checkout code repository
1617
uses: actions/checkout@v4
1718
with:
1819
fetch-depth: 0
1920

20-
- name: setup node.js
21-
uses: actions/setup-node@v4
22-
with:
23-
node-version: 20.11.0
24-
25-
- uses: pnpm/[email protected]
26-
with:
27-
run_install: false
28-
29-
- name: get pnpm store directory
30-
id: pnpm-cache
31-
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
32-
33-
- name: load cache
34-
uses: actions/cache@v4
35-
with:
36-
path: |
37-
~/.cache/Cypress
38-
${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
39-
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
40-
4121
- uses: nrwl/nx-set-shas@v4
4222

43-
- run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --require-explicit-completion
23+
- uses: ./.github/actions/setup
4424

4525
- name: install dependencies
4626
run: pnpm install
4727

28+
- name: run unit tests
29+
run: pnpm test:unit
30+
4831
# build all the packages to prepare for release
4932
- name: build packs
5033
run: pnpm build
5134

5235
- name: run lint
5336
run: pnpm test:lint --format github
5437

55-
- name: run unit tests
56-
run: pnpm test:unit
38+
- name: install browsers
39+
run: pnpm --filter=@milkdown/e2e test:install
5740

58-
- name: run cypress
59-
run: pnpm nx affected -t e2e-ci @milkdown/e2e
60-
61-
- run: npx nx-cloud complete-ci-run
62-
if: always()
63-
64-
- name: create versions or publish to npm registry
65-
uses: changesets/action@v1
66-
with:
67-
publish: pnpm release
68-
commit: 'ci(changeset): release milkdown'
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
- name: run playwright
42+
run: pnpm test:e2e
7243

73-
- name: Upload test results
44+
- name: upload test results
7445
if: ${{ failure() }}
7546
uses: actions/upload-artifact@v4
7647
with:
7748
name: test-results-main
78-
path: dist/cypress
79-
if-no-files-found: ignore
49+
path: e2e/playwright-report/
50+
retention-days: 7

Diff for: .github/workflows/fix.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# https://autofix.ci/setup
2+
3+
name: autofix.ci
4+
5+
on:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
fix:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: ./.github/actions/setup
18+
19+
- name: Fix
20+
run: pnpm fix
21+
22+
- uses: autofix-ci/action@ff86a557419858bb967097bfc916833f5647fa8c

Diff for: .github/workflows/release-package.yml

-53
This file was deleted.

Diff for: .github/workflows/release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- uses: ./.github/actions/setup
16+
17+
- name: build packs
18+
run: pnpm build
19+
20+
- name: Create versions or publish to npm registry
21+
uses: changesets/action@v1
22+
with:
23+
publish: pnpm release
24+
commit: 'ci(changeset): release milkdown'
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Diff for: .github/workflows/start-nx-cloud.yml

-39
This file was deleted.

0 commit comments

Comments
 (0)