WIP Migration guide/script updates #66
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: Test Affected | |
on: pull_request | |
jobs: | |
test-affected: | |
name: Test Affected | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# workaround for `git error: fatal: bad object` when using `--affected`: | |
# ensure PR base commit is fetched | |
# per https://stackoverflow.com/a/78153130 | |
fetch-depth: $(( ${{ github.event.pull_request.commits }} + 1 )) | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: pnpm | |
- name: Install Chrome | |
uses: browser-actions/setup-chrome@v1 | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Run affected tests | |
run: pnpm test:ci:affected | |
env: | |
# temporary workaround for `Failed to resolve base ref 'main' from GitHub Actions event`: | |
# manually set PR base commit ref | |
# per https://github.com/vercel/turborepo/issues/9320#issuecomment-2499219314 | |
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha }} |