name: Windows permissions: contents: read # Non-blocking Windows runs (#420; macOS dropped from CI in #571): never on pull requests or in the merge queue, and no context # here is a required check. A red run is fixed at its cause before the workspace cutover (#334). on: push: branches: [main] schedule: - cron: "17 3 * * *" workflow_dispatch: # Every run gets its own group (run_id), so no main commit's run is ever cancelled or dropped as pending. concurrency: group: ${{ github.workflow }}-${{ github.run_id }} cancel-in-progress: false env: PYTHONFAULTHANDLER: "1" # Time limit rule as in test.yml: ceil(1.5 x the slowest of three recent green runs on main) + 3 # minutes, never under 5, timed as whole-job wall time. One matrix job, so the slowest leg of each # run counts (tests/vendor/ci-workflow.test.mjs recomputes it, #493). # Measured 2026-10-29 on main runs 40935337099 (dd247e3), 40938407252 (dd247e3), 40941240624 (dd247e3): # slowest leg: 7m24s (py3.12 windows) / 7m31s (py3.13 windows) / 7m32s (py3.14 windows) -> 15 min # (windows 4m56s-7m32s) # native-trash-linux (#543) has no green main runs yet: it installs the dev requirements and runs # one test module, about 1 minute by the same estimate, so ceil(1.5 x 2) + 3 gives it 6 minutes. # Recalibrate after three green runs. jobs: test: name: py${{ matrix.python-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} timeout-minutes: 15 strategy: fail-fast: false matrix: os: [windows-latest] python-version: ["3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v7 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: requirements-dev.txt - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements-dev.txt # The runner's TEMP is on C:, the OS disk, where a flush took about 6 ms # and a test database's create-to-delete about 111 ms; on the D: work # disk the same took 0.5 ms and 23 ms. Tests write their # databases under TEMP, so it moves to a folder on D: (measured in #487, # run 40915866444). The runner's TEMP was an 8.3 short name # (C:\Users\RUNNER~1\...), so the new one is spelled by its short name too # and paths still have to be resolved. D: makes no short names by default # (run 40922502209), so they are switched on for it first. - name: Keep test files on the work disk (Windows) if: runner.os == 'Windows' shell: pwsh run: | fsutil 8dot3name set D: 0 $folder = New-Item -ItemType Directory -Force -Path (Join-Path $env:RUNNER_TEMP "PromptManagerTests") $short = (New-Object -ComObject Scripting.FileSystemObject).GetFolder($folder.FullName).ShortPath Write-Output "test TEMP: $short (long name $($folder.FullName))" if ($short -eq $folder.FullName) { Write-Output "::warning::D: gave the test TEMP no 8.3 short name" } "TEMP=$short" >> $env:GITHUB_ENV "TMP=$short" >> $env:GITHUB_ENV - name: Run tests env: PM_TEST_SLOWEST: "40" run: python -m tests.run_suite -v # The same tests as the fake mount table, on a real ext4 mount used as the output root (#543). A # runner can mount with sudo; the tests run as the normal user, so owner and mode checks are real. native-trash-linux: name: native trash on a real mount runs-on: ubuntu-latest timeout-minutes: 6 steps: - uses: actions/checkout@v7 - name: Set up Python uses: actions/setup-python@v7 with: python-version: "3.12" cache: pip cache-dependency-path: requirements-dev.txt - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements-dev.txt - name: Mount an ext4 image run: | truncate -s 64M "$RUNNER_TEMP/drive.img" mkfs.ext4 -q "$RUNNER_TEMP/drive.img" mkdir "$RUNNER_TEMP/drive" sudo mount -o loop "$RUNNER_TEMP/drive.img" "$RUNNER_TEMP/drive" sudo rmdir "$RUNNER_TEMP/drive/lost+found" sudo chown "$(id -u):$(id -g)" "$RUNNER_TEMP/drive" findmnt "$RUNNER_TEMP/drive" - name: Native trash proof timeout-minutes: 4 run: PM_TRASH_MOUNT="$RUNNER_TEMP/drive" python -m unittest tests.test_trash_mount_root -v