chore(deps): update dependency lint-staged to v15 #5267
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: pull-request | |
on: | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Test on node ${{matrix.node}} and ${{matrix.os}} | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
node: | |
- 18 | |
- 20 | |
- 22 | |
os: | |
#- macos-latest | |
- ubuntu-latest | |
#- windows-latest | |
env: | |
#PLAYWRIGHT_BROWSERS_PATH: ./cache/playwright | |
YARN_NODE_LINKER: pnp | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.1.6 | |
with: | |
# awaiting https://github.com/facebook/jest/issues/11271 | |
fetch-depth: 0 | |
#lfs: true | |
# awaiting https://github.com/actions/checkout/issues/317 | |
ref: ${{github.event.pull_request.head.ref}} | |
- name: Git LFS Hashes | |
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-hashes | |
- name: Restore Git LFS Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: lfs-cache | |
with: | |
path: .git/lfs | |
key: ${{matrix.os}}-lfs-${{hashFiles('.lfs-hashes')}} | |
restore-keys: | | |
${{matrix.os}}-lfs- | |
- name: Pull Git LFS | |
run: git lfs pull | |
- name: Setup Node@${{matrix.node}} | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version: ${{matrix.node}} | |
# awaiting https://github.com/actions/checkout/pull/155 | |
- name: Fetch Base Branch | |
run: git -c protocol.version=2 fetch --no-recurse-submodules --no-tags --progress --prune origin ${{github.event.pull_request.base.ref}}:${{github.event.pull_request.base.ref}} | |
- name: Yarn Cache Directory | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | |
- name: Restore Yarn Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: yarn-cache | |
with: | |
path: | | |
${{steps.yarn-cache-dir-path.outputs.dir}} | |
.yarn/install-state.gz | |
.yarn/unplugged | |
key: ${{matrix.os}}-${{matrix.node}}-yarn-${{hashFiles('**/yarn.lock')}} | |
restore-keys: | | |
${{matrix.os}}-${{matrix.node}}-yarn- | |
- name: Install Dependencies | |
run: yarn install --immutable | |
- name: Constraints | |
run: yarn constraints | |
- name: Restore TypeScript Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: typescript-cache | |
with: | |
path: "**/build" | |
key: ${{matrix.os}}-${{matrix.node}}-typescript-${{github.sha}} | |
restore-keys: | | |
${{matrix.os}}-${{matrix.node}}-typescript- | |
- name: Compile | |
run: yarn workspaces foreach --parallel --since="${{github.event.pull_request.base.ref}}" --topological-dev --verbose run compile | |
- name: Restore Jest Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: jest-cache | |
with: | |
path: "**/cache/jest" | |
key: ${{matrix.os}}-${{matrix.node}}-jest-${{github.sha}} | |
restore-keys: | | |
${{matrix.os}}-${{matrix.node}}-jest- | |
- name: Unit Test | |
run: yarn workspaces foreach --parallel --since="${{github.event.pull_request.base.ref}}" --verbose run test:ci:branch | |
- name: Restore ESLint Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: eslint-cache | |
with: | |
path: "**/.eslintcache" | |
key: ${{matrix.os}}-${{matrix.node}}-eslint-${{github.sha}} | |
restore-keys: | | |
${{matrix.os}}-${{matrix.node}}-eslint- | |
- name: Lint | |
run: yarn workspaces foreach --parallel --since="${{github.event.pull_request.base.ref}}" --verbose run lint:diff | |
- name: Restore Prettier Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: prettier-cache | |
with: | |
path: "**/.yarn/.cache/prettier" | |
key: ${{matrix.os}}-${{matrix.node}}-prettier-${{github.sha}} | |
restore-keys: | | |
${{matrix.os}}-${{matrix.node}}-prettier- | |
- name: Format | |
run: yarn workspaces foreach --parallel --since="${{github.event.pull_request.base.ref}}" --verbose run format:diff:check | |
- name: Restore Webpack Cache | |
uses: actions/cache/restore@v4.0.2 | |
id: webpack-cache | |
with: | |
path: "**/.yarn/.cache/webpack" | |
key: ${{matrix.os}}-${{matrix.node}}-webpack-${{github.sha}} | |
restore-keys: | | |
${{matrix.os}}-${{matrix.node}}-webpack- | |
- name: Build | |
run: yarn workspaces foreach --parallel --since="${{github.event.pull_request.base.ref}}" --topological-dev --verbose run build | |
- name: Bundle Size | |
run: yarn workspaces foreach --parallel --since="${{github.event.pull_request.base.ref}}" --verbose run bundlesize | |
#- name: Date (YYYYMM) | |
# id: date | |
# run: echo "::set-output name=date::$(/bin/date -u "+%Y%m")" | |
#- name: Restore Playwright Cache | |
# uses: actions/cache/restore@v4.0.2 | |
# id: playwright-cache | |
# with: | |
# path: ${{env.PLAYWRIGHT_BROWSERS_PATH}} | |
# key: ${{matrix.os}}-${{matrix.node}}-playwright-${{steps.date.outputs.date}} | |
- name: Playwright | |
id: playwright | |
run: | | |
yarn dlx playwright install --with-deps | |
yarn workspaces foreach --parallel --since="${{github.event.pull_request.base.ref}}" --verbose run playwright | |
- name: Upload Playwright Artifacts | |
uses: actions/upload-artifact@v4.3.3 | |
if: steps.playwright.outcome == 'failure' | |
with: | |
name: ${{matrix.os}}-${{matrix.node}}-playwright | |
path: ${{github.workspace}}/**/playwright/report/ | |
retention-days: 5 | |
- name: Lint Commits | |
run: yarn commitlint --from="${{github.event.pull_request.base.ref}}" | |
timeout-minutes: 15 |