From eba62fdd2ce4707b0b80a6995cb63ba38984b1dd Mon Sep 17 00:00:00 2001 From: Eli Fine <5436635+ejfine@users.noreply.github.com> Date: Tue, 22 Sep 2026 12:08:02 +0000 Subject: [PATCH] ci: allow long file paths before checking out on Windows Windows defaults to a 260 character path limit, and a checkout that cannot write a file fails the job before any step of it runs. Tooling that names files after the tests they belong to reaches that limit without the names being unreasonable, so a generated project with Windows runners can find its backend unit tests never running at all. The config has to be set before the checkout writes the files, so it leads every job that can run on Windows rather than living in a shared action. Jobs whose runners are chosen by matrix only get the step when use_windows_in_ci is set, so a project without Windows runners carries nothing dead. Co-Authored-By: Claude Opus 5 (1M context) --- template/.github/workflows/ci.yaml.jinja | 16 +++++++++++-- template/.github/workflows/release.yaml.jinja | 16 +++++++++++-- ...executable %}publish.yaml{% endif %}.jinja | 24 ++++++++++++++++--- ...%}publish_to_staging.yaml{% endif %}.jinja | 8 ++++++- 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/template/.github/workflows/ci.yaml.jinja b/template/.github/workflows/ci.yaml.jinja index 6a19c0c2..8ee529b1 100644 --- a/template/.github/workflows/ci.yaml.jinja +++ b/template/.github/workflows/ci.yaml.jinja @@ -77,7 +77,13 @@ jobs: timeout-minutes: {% endraw %}{{ gha_medium_timeout_minutes }}{% raw %} env: UV_PYTHON: ${{ matrix.python-version }} - steps: + steps:{% endraw %}{% if use_windows_in_ci %} + - name: Allow long file paths + if: runner.os == 'Windows' + # Some tooling (e.g. vcrpy, syrupy) generates file names past the 260 character limit Windows + # defaults to. This has to happen before the checkout that writes those files. + run: git config --global core.longpaths true +{% endif %}{% raw %} - name: Checkout code uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} @@ -170,7 +176,13 @@ jobs: env: UV_PYTHON: ${{ matrix.python-version }} - steps: + steps:{% endraw %}{% if use_windows_in_exe_ci %} + - name: Allow long file paths + if: runner.os == 'Windows' + # Some tooling (e.g. vcrpy, syrupy) generates file names past the 260 character limit Windows + # defaults to. This has to happen before the checkout that writes those files. + run: git config --global core.longpaths true +{% endif %}{% raw %} - name: Checkout code uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} - name: Install python tooling diff --git a/template/.github/workflows/release.yaml.jinja b/template/.github/workflows/release.yaml.jinja index b5341b68..dfb53f59 100644 --- a/template/.github/workflows/release.yaml.jinja +++ b/template/.github/workflows/release.yaml.jinja @@ -157,7 +157,13 @@ jobs: env: UV_PYTHON: ${{ matrix.python-version }} - steps: + steps:{% endraw %}{% if use_windows_in_ci %} + - name: Allow long file paths + if: runner.os == 'Windows' + # Some tooling (e.g. vcrpy, syrupy) generates file names past the 260 character limit Windows + # defaults to. This has to happen before the checkout that writes those files. + run: git config --global core.longpaths true +{% endif %}{% raw %} - name: Checkout code uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} - name: Setup python @@ -313,7 +319,13 @@ jobs: env: UV_PYTHON: ${{ matrix.python-version }} - steps: + steps:{% endraw %}{% if use_windows_in_ci %} + - name: Allow long file paths + if: runner.os == 'Windows' + # Some tooling (e.g. vcrpy, syrupy) generates file names past the 260 character limit Windows + # defaults to. This has to happen before the checkout that writes those files. + run: git config --global core.longpaths true +{% endif %}{% raw %} - name: Checkout code uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} - name: Setup python diff --git a/template/.github/workflows/{% if not deploy_as_executable %}publish.yaml{% endif %}.jinja b/template/.github/workflows/{% if not deploy_as_executable %}publish.yaml{% endif %}.jinja index 3aee9a26..742ae764 100644 --- a/template/.github/workflows/{% if not deploy_as_executable %}publish.yaml{% endif %}.jinja +++ b/template/.github/workflows/{% if not deploy_as_executable %}publish.yaml{% endif %}.jinja @@ -67,7 +67,13 @@ jobs: env: UV_PYTHON: ${{ matrix.python-version }} - steps: + steps:{% endraw %}{% if use_windows_in_ci %} + - name: Allow long file paths + if: runner.os == 'Windows' + # Some tooling (e.g. vcrpy, syrupy) generates file names past the 260 character limit Windows + # defaults to. This has to happen before the checkout that writes those files. + run: git config --global core.longpaths true +{% endif %}{% raw %} - name: Checkout code uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} @@ -180,7 +186,13 @@ jobs: env: UV_PYTHON: ${{ matrix.python-version }} - steps: + steps:{% endraw %}{% if use_windows_in_ci %} + - name: Allow long file paths + if: runner.os == 'Windows' + # Some tooling (e.g. vcrpy, syrupy) generates file names past the 260 character limit Windows + # defaults to. This has to happen before the checkout that writes those files. + run: git config --global core.longpaths true +{% endif %}{% raw %} - name: Checkout code uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} - name: Setup python @@ -326,7 +338,13 @@ jobs: env: UV_PYTHON: ${{ matrix.python-version }} - steps: + steps:{% endraw %}{% if use_windows_in_ci %} + - name: Allow long file paths + if: runner.os == 'Windows' + # Some tooling (e.g. vcrpy, syrupy) generates file names past the 260 character limit Windows + # defaults to. This has to happen before the checkout that writes those files. + run: git config --global core.longpaths true +{% endif %}{% raw %} - name: Checkout code uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %} - name: Setup python diff --git a/template/.github/workflows/{% if not deploy_as_executable %}publish_to_staging.yaml{% endif %}.jinja b/template/.github/workflows/{% if not deploy_as_executable %}publish_to_staging.yaml{% endif %}.jinja index 8d8aadc0..6a705008 100644 --- a/template/.github/workflows/{% if not deploy_as_executable %}publish_to_staging.yaml{% endif %}.jinja +++ b/template/.github/workflows/{% if not deploy_as_executable %}publish_to_staging.yaml{% endif %}.jinja @@ -41,7 +41,13 @@ jobs: env: UV_PYTHON: ${{ matrix.python-version }} - steps: + steps:{% endraw %}{% if use_windows_in_ci %} + - name: Allow long file paths + if: runner.os == 'Windows' + # Some tooling (e.g. vcrpy, syrupy) generates file names past the 260 character limit Windows + # defaults to. This has to happen before the checkout that writes those files. + run: git config --global core.longpaths true +{% endif %}{% raw %} - name: Checkout code uses: actions/checkout@{% endraw %}{{ gha_checkout }}{% raw %}