-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: fix pull request workflows (#105)
- Loading branch information
Showing
5 changed files
with
85 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Setup | ||
description: Setup the environment | ||
|
||
inputs: | ||
node-version: | ||
description: The version of node.js | ||
required: false | ||
default: '20' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: pnpm/[email protected] | ||
with: | ||
run_install: false | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: pnpm | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install | ||
run: pnpm install | ||
shell: bash | ||
|
||
- name: Build packages | ||
run: pnpm build | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,56 +2,32 @@ name: ci | |
|
||
on: | ||
push: | ||
branches: main | ||
branches: [main] | ||
pull_request: | ||
branches: main | ||
branches: [main] | ||
|
||
env: | ||
CI: true | ||
jobs: | ||
release: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: setup node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.11.0 | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
run_install: false | ||
|
||
- name: get pnpm store directory | ||
id: pnpm-cache | ||
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
|
||
- name: load cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cache/Cypress | ||
${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
|
||
- name: install dependencies | ||
run: pnpm install | ||
- uses: ./.github/actions/setup | ||
|
||
- name: build packs | ||
run: pnpm build | ||
- name: Lint | ||
run: pnpm run lint | ||
|
||
- name: run lint test | ||
run: pnpm lint | ||
- name: Install cypress | ||
run: pnpm run install:cypress | ||
|
||
- name: setup firefox | ||
- name: Setup firefox | ||
uses: browser-actions/setup-firefox@latest | ||
with: | ||
firefox-version: latest-esr | ||
|
||
- name: run e2e test on chrome | ||
- name: Run e2e test on chrome | ||
uses: cypress-io/github-action@v6 | ||
env: | ||
CYPRESS_SERVER_PORT: 7000 | ||
|
@@ -63,7 +39,7 @@ jobs: | |
wait-on: 'http://localhost:7000' | ||
browser: chrome | ||
|
||
- name: run e2e test on firefox | ||
- name: Run e2e test on firefox | ||
uses: cypress-io/github-action@v6 | ||
env: | ||
CYPRESS_SERVER_PORT: 7001 | ||
|
@@ -74,28 +50,3 @@ jobs: | |
start: pnpm exec vite preview --port 7001 --host | ||
wait-on: 'http://localhost:7001' | ||
browser: firefox | ||
|
||
- name: create versions or publish to npm registry | ||
uses: changesets/action@v1 | ||
with: | ||
publish: pnpm release | ||
commit: 'ci(changeset): release prosemirror-adapter' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: export screenshots (on failure only) | ||
uses: actions/[email protected] | ||
if: ${{ failure() }} | ||
with: | ||
name: cypress-screenshots | ||
path: e2e/cypress/screenshots | ||
retention-days: 7 | ||
|
||
- name: export screen recordings (on failure only) | ||
uses: actions/[email protected] | ||
if: ${{ failure() }} | ||
with: | ||
name: cypress-videos | ||
path: e2e/cypress/videos | ||
retention-days: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ./.github/actions/setup | ||
|
||
- name: Create versions or publish to npm registry | ||
uses: changesets/action@v1 | ||
with: | ||
publish: pnpm release | ||
commit: 'ci(changeset): release prosemirror-adapter' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Export screenshots (on failure only) | ||
uses: actions/[email protected] | ||
if: ${{ failure() }} | ||
with: | ||
name: cypress-screenshots | ||
path: e2e/cypress/screenshots | ||
retention-days: 7 | ||
|
||
- name: Export screen recordings (on failure only) | ||
uses: actions/[email protected] | ||
if: ${{ failure() }} | ||
with: | ||
name: cypress-videos | ||
path: e2e/cypress/videos | ||
retention-days: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters