name: CI on: push: branches: - next pull_request: merge_group: permissions: contents: read # to fetch code (actions/checkout) jobs: unit-test: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] node_version: [20, 22, 24] fail-fast: false timeout-minutes: 10 name: 'Build & Unit Test: node-${{ matrix.node_version }}, ${{ matrix.os }}' steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: # Required for docs/versions tests fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - name: Set node version to ${{ matrix.node_version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: ${{ matrix.node_version }} cache: 'pnpm' - name: Install deps run: pnpm install - name: Build run: pnpm run build - name: Test run: pnpm run test timezone-test: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] node_version: [24] fail-fast: false env: LANG: zh_SG.UTF-8 TZ: Asia/Singapore timeout-minutes: 10 name: 'Timezone Test: node-${{ matrix.node_version }}, ${{ matrix.os }}' steps: - name: Set system LANG=zh_SG.UTF-8 run: | sudo locale-gen zh_SG.UTF-8 sudo update-locale LANG=zh_SG.UTF-8 - name: Check date run: date - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: # Required for docs/versions tests fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - name: Set node version to ${{ matrix.node_version }} uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: ${{ matrix.node_version }} cache: 'pnpm' - name: Install deps run: pnpm install - name: Build run: pnpm run build - name: Test run: pnpm run test e2e-test: runs-on: ubuntu-latest container: image: cypress/browsers:24.0.0@sha256:fe122441daa9ac524d5ea50da485f240fd2f037b3352fc4dfafe561cfc65cb18 options: --user 1001 timeout-minutes: 10 name: 'E2E Doc Test: node-24, ubuntu-latest' steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Install pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - name: Install deps run: pnpm install - name: Build docs run: pnpm run docs:build:ci - name: Download Cypress run: pnpm run docs:test:e2e:install - id: e2e name: Run e2e run: pnpm run docs:test:e2e:run lint: runs-on: ubuntu-latest timeout-minutes: 10 name: 'Lint: node-24, ubuntu-latest' steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - name: Set node version to 24 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 24.6.0 cache: 'pnpm' - name: Install deps run: pnpm install - name: Lint run: pnpm run lint - name: Check formatting run: pnpm prettier --check . ts-check: runs-on: ubuntu-latest timeout-minutes: 10 name: 'TS-Check: node-24, ubuntu-latest' steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - name: Set node version to 24 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 24.6.0 cache: 'pnpm' - name: Install deps run: pnpm install - name: Build types run: pnpm run build - name: Check scripts run: pnpm run ts-check codecov: runs-on: ubuntu-latest timeout-minutes: 10 name: 'Codecov: node-24, ubuntu-latest' steps: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - name: Install pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 - name: Set node version to 24 uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 24.6.0 cache: 'pnpm' - name: Install deps run: pnpm install - name: Build run: pnpm run build - name: Generate coverage report run: pnpm vitest run --coverage - name: Upload coverage to Codecov uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true