Changes in a sub directory are treated as new documents on windows #878
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: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
build: | |
name: Build and Test | |
timeout-minutes: 15 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
CC_OS: ${{ matrix.os }} | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1" | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build cli | |
run: pnpm build --filter=@content-collections/cli | |
- name: Install cli binary | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: (non-windows) Set Playwright path and Get playwright version | |
if: runner.os != 'Windows' | |
run: | | |
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV | |
PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w @playwright/test | jq --raw-output '.[0].devDependencies["@playwright/test"].version')" | |
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | |
- name: (windows) Set Playwright path and Get playwright version | |
if: runner.os == 'Windows' | |
run: | | |
echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV | |
$env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w @playwright/test | jq --raw-output '.[0].devDependencies["@playwright/test"].version')" | |
echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV | |
- name: Cache Playwright's binary | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
key: ${{ runner.os }}-playwright-bin-v1-${{ env.PLAYWRIGHT_VERSION }} | |
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | |
restore-keys: | | |
${{ runner.os }}-playwright-bin-v1- | |
- name: Install Chromium for Playwright with deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
run: pnpm playwright install chromium --with-deps | |
- name: Install Chromium for Playwright with deps | |
if: steps.playwright-cache.outputs.cache-hit == 'true' | |
run: pnpm playwright install install-deps | |
- name: Test | |
run: pnpm test |