Update changesets' auto-commit feature to not suppress CI on commits #2833
Workflow file for this run
This file contains 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: Node CI | |
on: | |
pull_request: | |
# edited is needed because that's the trigger when the base branch is | |
# changed on a PR | |
# The rest are the defaults. | |
types: [edited, opened, synchronize, reopened] | |
# Our jobs run like this to minimize wasting resource cycles: | |
# 1. Prime caches for primary configuration (ubuntu on node 14). | |
# This way the next two jobs can run in parallel but rely on this primed | |
# cache. | |
# 2. Lint and coverage | |
# a. Lint | |
# b. Coverage | |
# 3. Run tests for remaining configurations | |
# Since these don't share caches, we don't need to prime those caches. | |
jobs: | |
prime_cache_primary: | |
name: Prime node_modules cache for primary configuration | |
env: | |
CI: true | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install & cache node_modules | |
uses: Khan/actions@shared-node-cache-v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
lint: | |
needs: [prime_cache_primary] | |
name: Lint, typecheck, and coverage check | |
env: | |
CI: true | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [20.x] | |
steps: | |
- name: Checking out latest commit | |
uses: actions/checkout@v4 | |
- name: Install & cache node_modules | |
uses: Khan/actions@shared-node-cache-v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Get All Changed Files | |
uses: Khan/actions@get-changed-files-v2 | |
id: changed | |
- id: js-ts-files | |
name: Find .js/.ts changed files | |
uses: Khan/actions@filter-files-v1 | |
with: | |
changed-files: ${{ steps.changed.outputs.files }} | |
extensions: '.js,.jsx,.ts,.tsx' | |
- id: eslint-reset | |
uses: Khan/actions@filter-files-v1 | |
name: Files that would trigger a full eslint run | |
with: | |
changed-files: ${{ steps.changed.outputs.files }} | |
files: '.eslintrc.js,yarn.lock,.eslintignore' | |
- name: Build so that inter-package references are resolved | |
run: yarn build | |
- name: Build Types | |
run: yarn build:types | |
# Linting / type checking | |
- name: Eslint | |
uses: Khan/actions@full-or-limited-v0 | |
with: | |
full-trigger: ${{ steps.eslint-reset.outputs.filtered }} | |
full: yarn lint:ci . | |
limited-trigger: ${{ steps.js-ts-files.outputs.filtered }} | |
limited: yarn lint:ci {} | |
- name: Typecheck | |
if: steps.js-ts-files.outputs.filtered != '[]' | |
run: yarn typecheck | |
# Collect and record coverage | |
- name: Run Jest with coverage | |
run: yarn coverage | |
- name: Upload Coverage | |
# We don't bother collecting a record of coverage for dependabot changes | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage/coverage-final.json | |
fail_ci_if_error: true | |
- uses: Khan/actions@check-for-changeset-v1 | |
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' | |
with: | |
exclude: .github/,.storybook/ | |
- name: Pre-publish check | |
run: node utils/pre-publish-check-ci.js | |
# Make sure our packages aren't growing unexpectedly | |
# This must come last as it builds the old code last and so leaves the | |
# wrong code in place for the next job. | |
- name: Check Builds | |
uses: preactjs/compressed-size-action@v2 | |
with: | |
# We only care about the browser ES module size, really: | |
pattern: "**/dist/browser/es/index.js" | |
# Always ignore SourceMaps and node_modules: | |
exclude: "{**/*.map,**/node_modules/**}" | |
# Clean up before a build | |
clean-script: "clean" | |
# Build production | |
build-script: "build:prodsizecheck" | |
# | |
# Do not place any steps after "Check Builds" | |
# | |
test: | |
needs: [lint] | |
name: Test | |
env: | |
CI: true | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
# We want to include all the versions we support here. | |
node-version: [20.x] | |
exclude: | |
# And exclude the configuration that our coverage job already | |
# includes. | |
- os: ubuntu-latest | |
node-version: 20.x | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install & cache node_modules | |
uses: Khan/actions@shared-node-cache-v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Get All Changed Files | |
uses: Khan/actions@get-changed-files-v2 | |
id: changed | |
- name: Build so that inter-package references are resolved | |
run: yarn build | |
- id: jest-reset | |
uses: Khan/actions@filter-files-v1 | |
name: Files that would trigger a full Jest run | |
with: | |
changed-files: ${{ steps.changed.outputs.files }} | |
files: | | |
jest.config.js | |
yarn.lock | |
test.config.js | |
test.transform.js | |
- id: js-ts-files | |
name: Find .js/.ts changed files | |
uses: Khan/actions@filter-files-v1 | |
with: | |
changed-files: ${{ steps.changed.outputs.files }} | |
extensions: '.js,.jsx,.ts,.tsx' | |
- name: Jest | |
uses: Khan/actions@full-or-limited-v0 | |
with: | |
full-trigger: ${{ steps.jest-reset.outputs.filtered }} | |
full: yarn test | |
limited-trigger: ${{ steps.js-ts-files.outputs.filtered }} | |
limited: yarn test --findRelatedTests --passWithNoTests {} |