Debug next package lookup context dir #28
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: build-and-test-windows | |
on: | |
push: | |
branches: ['canary', 'hl/turbopack-debugging'] | |
pull_request: | |
types: [opened, synchronize] | |
env: | |
NAPI_CLI_VERSION: 2.16.2 | |
TURBO_VERSION: 2.1.2 | |
NODE_LTS_VERSION: 20 | |
TURBO_TEAM: 'vercel' | |
NEXT_TELEMETRY_DISABLED: 1 | |
# we build a dev binary for use in CI so skip downloading | |
# canary next-swc binaries in the monorepo | |
NEXT_SKIP_NATIVE_POSTINSTALL: 1 | |
NEXT_TEST_JOB: 1 | |
jobs: | |
optimize-ci: | |
uses: ./.github/workflows/graphite_ci_optimizer.yml | |
secrets: inherit | |
changes: | |
name: Determine changes | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 25 | |
- name: check for docs only change | |
id: docs-change | |
run: | | |
echo "DOCS_ONLY<<EOF" >> $GITHUB_OUTPUT; | |
echo "$(node scripts/run-for-change.js --not --type docs --exec echo 'false')" >> $GITHUB_OUTPUT; | |
echo 'EOF' >> $GITHUB_OUTPUT | |
- name: check for release | |
id: is-release | |
run: | | |
if [[ $(node ./scripts/check-is-release.js 2> /dev/null || :) = v* ]]; | |
then | |
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT | |
else | |
echo "IS_RELEASE=false" >> $GITHUB_OUTPUT | |
fi | |
outputs: | |
docs-only: ${{ steps.docs-change.outputs.DOCS_ONLY != 'false' }} | |
is-release: ${{ steps.is-release.outputs.IS_RELEASE == 'true' }} | |
test-turbopack-dev: | |
name: test-turbopack-dev | |
needs: ['optimize-ci', 'changes'] | |
if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} | |
runs-on: | |
- 'self-hosted' | |
- 'windows' | |
- 'x64' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 25 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_LTS_VERSION }} | |
check-latest: true | |
- name: Install global dependencies | |
run: | | |
corepack enable | |
npm i -g "turbo@${TURBO_VERSION}" "@napi-rs/cli@${NAPI_CLI_VERSION}" | |
- name: Install Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
targets: x86_64-pc-windows-msvc | |
- name: Print Rust version | |
run: rustc --version | |
# normalize versions before build-native for better cache hits | |
- run: node scripts/normalize-version-bump.js | |
name: normalize versions | |
- name: Cache on ${{ github.ref_name }} | |
uses: ijjk/rust-cache@turbo-cache-v1.0.8 | |
with: | |
cache-provider: 'turbo' | |
save-if: 'false' | |
shared-key: build-x86_64-pc-windows-msvc-${{ hashFiles('.cargo/config.toml') }} | |
- name: Clear native build | |
run: Remove-Item packages/next-swc/native -Recurse -Force -ErrorAction SilentlyContinue | |
- name: Build native | |
# --env-mode loose is a breaking change required with turbo 2.x since Strict mode is now the default | |
# TODO: we should add the relevant envs later to to switch to strict mode | |
run: turbo run build-native-release -vvv --env-mode loose --remote-cache-timeout 90 --summarize -- -- --target x86_64-pc-windows-msvc | |
# undo normalize version changes | |
- run: git checkout . | |
- name: Install | |
run: pnpm install | |
- name: Build | |
run: pnpm build | |
- name: Install Chromium | |
run: pnpm playwright install chromium | |
- name: Run Tests | |
# Only run selected tests on Windows. | |
run: node run-tests.js -c 1 --debug test/e2e/app-dir/server-source-maps/server-source-maps.test.ts | |
env: | |
TURBOPACK: 1 | |
TURBOPACK_DEV: 1 | |
NEXT_E2E_TEST_TIMEOUT: 240000 | |
NEXT_TEST_MODE: dev |