-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(CI): modify test ci yaml to make pr merge correctly (#747)
- Loading branch information
1 parent
53a8598
commit 961c20c
Showing
3 changed files
with
44 additions
and
52 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,43 +9,13 @@ on: | |
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
# ======== calculate changes ======== | ||
changes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
changed: ${{ steps.changes.outputs.changed }} | ||
strategy: | ||
matrix: | ||
node-version: [18] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 10 | ||
|
||
- name: Install pnpm | ||
run: | | ||
npm install -g corepack@latest --force | ||
corepack enable | ||
- uses: dorny/[email protected] | ||
id: changes | ||
with: | ||
predicate-quantifier: 'every' | ||
filters: | | ||
changed: | ||
- "!**/*.md" | ||
- "!**/*.mdx" | ||
- "!**/_meta.json" | ||
- "!**/dictionary.txt" | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# ======== ut ======== | ||
ut: | ||
runs-on: ${{ matrix.os }} | ||
needs: changes | ||
if: ${{ needs.changes.outputs.changed == 'true' }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
@@ -58,7 +28,7 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 10 | ||
fetch-depth: 1 | ||
|
||
- name: Git config | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
|
@@ -71,26 +41,39 @@ jobs: | |
npm install -g corepack@latest --force | ||
corepack enable | ||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | ||
id: changes | ||
with: | ||
predicate-quantifier: 'every' | ||
filters: | | ||
changed: | ||
- "!**/*.md" | ||
- "!**/*.mdx" | ||
- "!**/_meta.json" | ||
- "!**/dictionary.txt" | ||
- name: Setup Node.js ${{ matrix.node-version }} | ||
if: steps.changes.outputs.changed == 'true' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
|
||
- name: Install Dependencies | ||
if: steps.changes.outputs.changed == 'true' | ||
run: pnpm install | ||
|
||
- name: Type Check | ||
if: steps.changes.outputs.changed == 'true' | ||
run: pnpm run type-check | ||
|
||
- name: Unit Test | ||
if: steps.changes.outputs.changed == 'true' | ||
run: pnpm run test:unit | ||
|
||
# ======== integration && e2e ======== | ||
integration-e2e: | ||
runs-on: ${{ matrix.os }} | ||
needs: changes | ||
if: ${{ needs.changes.outputs.changed == 'true' }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
@@ -100,42 +83,48 @@ jobs: | |
os: windows-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Git config | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
shell: bash | ||
run: | | ||
git config --system core.longpaths true | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 10 | ||
|
||
- name: Install pnpm | ||
run: | | ||
npm install -g corepack@latest --force | ||
corepack enable | ||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | ||
id: changes | ||
with: | ||
predicate-quantifier: 'every' | ||
filters: | | ||
changed: | ||
- "!**/*.md" | ||
- "!**/*.mdx" | ||
- "!**/_meta.json" | ||
- "!**/dictionary.txt" | ||
- name: Setup Node.js ${{ matrix.node-version }} | ||
if: steps.changes.outputs.changed == 'true' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
|
||
- name: Install Dependencies | ||
if: steps.changes.outputs.changed == 'true' | ||
run: pnpm install && cd ./tests && pnpm playwright install chromium | ||
|
||
- name: Integration Test (Vitest) | ||
if: steps.changes.outputs.changed == 'true' | ||
run: pnpm run test:integration | ||
|
||
- name: E2E Test (Playwright) | ||
if: steps.changes.outputs.changed == 'true' | ||
run: pnpm run test:e2e | ||
|
||
# ======== exit ======== | ||
pr-check-required: | ||
if: (!cancelled() && !failure()) | ||
needs: [ut, integration-e2e] | ||
runs-on: ubuntu-latest | ||
name: Test passed or skipped | ||
steps: | ||
- run: echo "All tests passed or skipped." |