Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:

workflow_dispatch:

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -27,7 +30,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: 'pnpm'

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: 'pnpm'

- name: Install Dependencies
Expand Down
89 changes: 39 additions & 50 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,13 @@

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]
Expand All @@ -58,9 +28,9 @@
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 10
fetch-depth: 1

- name: Git config

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium test

Unpinned 3rd party Action 'Test' step
Uses Step: changes
uses 'dorny/paths-filter' with ref 'v3.0.2', not a pinned commit hash
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: |
Expand All @@ -71,26 +41,39 @@
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"

- 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]
Expand All @@ -100,42 +83,48 @@
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/[email protected]
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."
Loading