Bump actions/upload-artifact from 4 to 6 #19
This file contains hidden or 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
| name: Pull Request Checks | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| jobs: | |
| lint-and-format: | |
| runs-on: ubuntu-latest | |
| name: Lint and Format Check | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint check | |
| run: npm run lint | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Test (Node ${{ matrix.node-version }} - ${{ matrix.browser }}) | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 4 | |
| matrix: | |
| include: | |
| # Test all browsers on LTS | |
| - node-version: 22 | |
| browser: chromium | |
| - node-version: 22 | |
| browser: firefox | |
| - node-version: 22 | |
| browser: webkit | |
| # Test only chromium on latest | |
| - node-version: 24 | |
| browser: chromium | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build library | |
| run: npm run build | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ matrix.browser }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| playwright-${{ runner.os }}-${{ matrix.browser }}- | |
| playwright-${{ runner.os }}- | |
| - name: Install Playwright | |
| run: npx playwright install --with-deps ${{ matrix.browser }} | |
| - name: Run Playwright tests | |
| run: npx playwright test --project=${{ matrix.browser }} | |
| - name: Upload test results | |
| if: failure() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: test-results-${{ matrix.node-version }}-${{ matrix.browser }} | |
| path: test-results/ | |
| retention-days: 7 | |
| - name: Upload HTML report | |
| if: failure() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: playwright-report-${{ matrix.node-version }}-${{ matrix.browser }} | |
| path: playwright-report/ | |
| retention-days: 7 | |
| bundle-size: | |
| runs-on: ubuntu-latest | |
| name: Bundle Size Check | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build library | |
| run: npm run build | |
| - name: Check bundle size | |
| run: | | |
| echo "## Bundle Size Report" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| File | Size |" >> $GITHUB_STEP_SUMMARY | |
| echo "|------|------|" >> $GITHUB_STEP_SUMMARY | |
| echo "| dist/debounced.js | $(du -h dist/debounced.js | cut -f1) |" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Gzipped size: $(gzip -c dist/debounced.js | wc -c | awk '{printf "%.2f KB", $1/1024}')" >> $GITHUB_STEP_SUMMARY |