fix: return '0 seconds' for zero input in formatAsTimePhrase #3338
Workflow file for this run
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: CI | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| name: Run Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| # this line is required for the setup-node action to be able to run the npm publish below. | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: npm ci | |
| - run: npm run lint | |
| # Install Playwright after linting, so that we have a faster linting process. | |
| # Caching logic adapted from https://github.com/microsoft/playwright/issues/7249#issuecomment-1385567519 | |
| - name: Store Playwright's Version | |
| run: | | |
| PLAYWRIGHT_VERSION=$(npm view @web/test-runner-playwright dependencies.playwright) | |
| echo "Playwright's Version: $PLAYWRIGHT_VERSION" | |
| echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | |
| - name: Cache Playwright Browsers for Playwright's Version | |
| id: cache-playwright-browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} | |
| - name: Remove man-db to speed up apt installs | |
| run: sudo apt-get remove -y man-db | |
| - run: npx playwright install --with-deps | |
| if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' | |
| - run: npx playwright install-deps | |
| if: steps.cache-playwright-browsers.outputs.cache-hit == 'true' | |
| - run: npm run test:unit:all | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| verbose: true | |
| - run: npm run manifest | |
| - run: npm run build | |
| test-examples: | |
| name: Run Tests on Example Pages | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - run: npm ci | |
| - name: Store Playwright's Version | |
| run: | | |
| PLAYWRIGHT_VERSION=$(npm view @web/test-runner-playwright dependencies.playwright) | |
| echo "Playwright's Version: $PLAYWRIGHT_VERSION" | |
| echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | |
| - name: Cache Playwright Browsers for Playwright's Version | |
| id: cache-playwright-browsers | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} | |
| - name: Remove man-db to speed up apt installs | |
| run: sudo apt-get remove -y man-db | |
| - run: npx playwright install --with-deps | |
| if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' | |
| - run: npx playwright install-deps | |
| if: steps.cache-playwright-browsers.outputs.cache-hit == 'true' | |
| - run: npm run manifest | |
| - run: npm run build | |
| - name: Install React example dependencies (vite-react) | |
| run: yarn install --frozen-lockfile | |
| working-directory: ./examples/vite-react-with-typescript | |
| - name: Install React example dependencies (nextjs) | |
| run: npm ci | |
| working-directory: ./examples/nextjs-with-typescript | |
| - run: npm run test:examples |