diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e95b790f2..2ed54538b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,6 +9,9 @@ on: workflow_dispatch: +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6afc42e1..da0a9f9fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dcc27a7fa..b59803179 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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/paths-filter@v3.0.2 - 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."