name: 'test' on: workflow_call permissions: contents: read # to fetch code (actions/checkout) jobs: unit-test: runs-on: ubuntu-latest env: PUPPETEER_SKIP_DOWNLOAD: 'true' steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Install pnpm uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - name: Install Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: '.node-version' cache: 'pnpm' - run: pnpm install - name: Run unit tests run: pnpm run test-unit unit-test-windows: runs-on: windows-latest env: PUPPETEER_SKIP_DOWNLOAD: 'true' steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Install pnpm uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - name: Install Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: '.node-version' cache: 'pnpm' - run: pnpm install - name: Run compiler unit tests run: pnpm run test-unit compiler - name: Run ssr unit tests run: pnpm run test-unit server-renderer e2e-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Setup cache for Chromium binary uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ~/.cache/puppeteer key: chromium-${{ hashFiles('pnpm-lock.yaml') }} - name: Setup cache for Playwright browsers uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: ~/.cache/ms-playwright key: playwright-${{ hashFiles('pnpm-lock.yaml') }} - name: Install pnpm uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - name: Install Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: '.node-version' cache: 'pnpm' - run: pnpm install - run: node node_modules/puppeteer/install.mjs - run: pnpm exec playwright install chromium - name: Run e2e tests run: pnpm run test-e2e - name: verify treeshaking run: node scripts/verify-treeshaking.js lint-and-test-dts: runs-on: ubuntu-latest env: PUPPETEER_SKIP_DOWNLOAD: 'true' steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Install pnpm uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 - name: Install Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version-file: '.node-version' cache: 'pnpm' - run: pnpm install - name: Run eslint run: pnpm run lint - name: Run prettier run: pnpm run format-check - name: Run tsc run: pnpm run check - name: Run type declaration tests run: pnpm run test-dts