Skip to content

Fix Storybook viewports #7864

Fix Storybook viewports

Fix Storybook viewports #7864

Workflow file for this run

name: Node CI (PR)
on:
pull_request:
# ready_for_review is useful for when a PR is converted from "draft" to "not
# draft".
types: [edited, opened, synchronize, ready_for_review, reopened]
# When a new revision is pushed to a PR, cancel all in-progress CI runs for that
# PR. See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# Our jobs run like this to minimize wasting resource cycles:
# 1. Prime caches for primary configuration (ubuntu on node 16).
# This way the next two jobs can run in parallel but rely on this primed
# cache.
# 2. Lint and Test
# a. Lint
# b. Test/Coverage
# 3. Verify that build sizes are reasonable
jobs:
prime_cache_primary:
name: Prime node_modules cache for primary configuration
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Install & cache node_modules
uses: ./.github/actions/shared-node-cache
with:
node-version: ${{ matrix.node-version }}
changeset:
name: Check for .changeset entries for all changed files
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Khan/actions@check-for-changeset-v1
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
with:
exclude: .github/,.storybook/
exclude_extensions: .test.ts, .test.tsx, .stories.ts, .stories.tsx, .mdx
exclude_globs: "**/__tests__/*, **/__docs__/*"
lint:
name: Lint
needs: prime_cache_primary
uses: ./.github/workflows/node-ci-lint.yml
test:
name: Test
needs: prime_cache_primary
uses: ./.github/workflows/node-ci-test.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
check_builds:
name: Check build sizes
needs: prime_cache_primary
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install & cache node_modules
uses: ./.github/actions/shared-node-cache
with:
node-version: ${{ matrix.node-version }}
# Make sure our packages aren't growing unexpectedly
- name: Check Builds
uses: preactjs/compressed-size-action@v2
with:
# Specify our custom build script
build-script: "build"
# Clean up state between builds
clean-script: "clean"
# Any JS files anywhere within a dist directory:
pattern: "**/dist/es/*.js"
# Always ignore SourceMaps and node_modules:
exclude: "{**/*.map,**/node_modules/**}"