From ff49ff920e9d403d3a4e2335aada2fe56b591b20 Mon Sep 17 00:00:00 2001 From: Hal <22532613+HalRiveria@users.noreply.github.com> Date: Tue, 27 Oct 2026 13:34:05 -0400 Subject: [PATCH 1/2] Add CI test run and release zip workflows Tests: runs every harness under Windows PowerShell 5.1 on pull requests and pushes to main. Release zip: when a release is published, builds the install zip (main script plus Modules) and attaches it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release-zip.yml | 34 +++++++++++++++++++++++++ .github/workflows/tests.yml | 42 +++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/release-zip.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/release-zip.yml b/.github/workflows/release-zip.yml new file mode 100644 index 0000000..d672b33 --- /dev/null +++ b/.github/workflows/release-zip.yml @@ -0,0 +1,34 @@ +name: Release zip + +# Attaches the install zip (the main script plus Modules\, nothing else) to a +# release when it is published. Re-run by hand for an existing tag if needed. +on: + release: + types: [published] + workflow_dispatch: + inputs: + tag: + description: Existing release tag to build the zip for (e.g. v1.1) + required: true + +permissions: + contents: write + +jobs: + zip: + name: Build and attach install zip + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name || inputs.tag }} + + - name: Build and upload + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ github.event.release.tag_name || inputs.tag }} + run: | + zip="Manga-Conversion-Script-${TAG}.zip" + git archive --format=zip --prefix="Manga Conversion Script/" -o "$zip" HEAD "Conversion Script Main.ps1" Modules + unzip -l "$zip" + gh release upload "$TAG" "$zip" --clobber diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..eb0f620 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,42 @@ +name: Tests + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + harnesses: + name: Harnesses + runs-on: windows-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + + # Windows PowerShell 5.1 (shell: powershell), the version the script targets. + # The harnesses build their own stand-in cjxl/magick, so no real tools are needed. + - name: Run every harness + shell: powershell + run: | + $failed = @() + foreach ($harness in Get-ChildItem -Path .\_Harness -Filter *.Harness.ps1 | Sort-Object Name) { + Write-Host ("::group::" + $harness.BaseName) + & powershell.exe -NoProfile -ExecutionPolicy Bypass -File $harness.FullName + $code = $LASTEXITCODE + Write-Host "::endgroup::" + if ($code -eq 0) { + Write-Host ("PASS " + $harness.BaseName) + } else { + Write-Host ("::error title=" + $harness.BaseName + "::exited with code " + $code) + $failed += $harness.BaseName + } + } + if ($failed.Count -gt 0) { + Write-Host ("Failed: " + ($failed -join ", ")) + exit 1 + } + Write-Host "All harnesses passed." From 6902fc4dcdd4fd0db24e8937594b9b2af16208bb Mon Sep 17 00:00:00 2001 From: Hal <22532613+HalRiveria@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:07:10 -0400 Subject: [PATCH 2/2] FileDeletion harness: skip the Recycle Bin lookup on GitHub Actions GitHub's Windows runners run as a service with no interactive shell, so the Recycle Bin can't be browsed there. On CI the test checks only that the file left its original location; locally it still checks the bin. Co-Authored-By: Claude Opus 5.5 --- _Harness/FileDeletion.Harness.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/_Harness/FileDeletion.Harness.ps1 b/_Harness/FileDeletion.Harness.ps1 index 33ccd37..8e38c34 100644 --- a/_Harness/FileDeletion.Harness.ps1 +++ b/_Harness/FileDeletion.Harness.ps1 @@ -154,8 +154,15 @@ Write-Host "=== Scenario G: Move-ToRecycleBin target actually lands in the Recyc $uniqueNameG = "filedeletion-harness-" + [guid]::NewGuid().ToString("N") + ".txt" $fileG = New-ScratchFile -Name $uniqueNameG $null = Move-ToRecycleBin -ItemPath $fileG -$foundInBinG = Test-ItemInRecycleBin -FileName $uniqueNameG -Test-Assert $foundInBinG "Move-ToRecycleBin's target is found in the real Windows Recycle Bin (genuinely recoverable, not just deleted)" +if ($env:GITHUB_ACTIONS -eq 'true') { + # GitHub's Windows runners run as a service with no interactive shell, so + # the Recycle Bin can't be browsed there. Check only that the file left. + Test-Assert (-not (Test-Path -LiteralPath $fileG)) "Move-ToRecycleBin's target is gone from its original location" + Write-Host " [SKIP] Recycle Bin lookup - not available on GitHub Actions runners" -ForegroundColor Yellow +} else { + $foundInBinG = Test-ItemInRecycleBin -FileName $uniqueNameG + Test-Assert $foundInBinG "Move-ToRecycleBin's target is found in the real Windows Recycle Bin (genuinely recoverable, not just deleted)" +} Write-Host "" # ==============================================================================