Add quick test and fix Windows clipboard check

Run `go test -v ./...` in the release workflow before GoReleaser.
In the Windows test job replace Get-Clipboard with
System.Windows.Forms::GetFileDropList(), check for "$PWD\ctx.txt" and
improve success/error output.
This commit is contained in:
2026-01-31 02:00:13 +01:00
parent af9e0a5372
commit bd22ad5500
2 changed files with 10 additions and 5 deletions
+4
View File
@@ -22,6 +22,10 @@ jobs:
with: with:
go-version: stable go-version: stable
- name: Quick Sanity Check
shell: bash
run: go test -v ./...
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v6
with: with:
+6 -5
View File
@@ -43,10 +43,11 @@ jobs:
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
run: | run: |
./ctx.exe . ./ctx.exe .
$files = Get-Clipboard -Format FileDropList Add-Type -AssemblyName System.Windows.Forms
if ($files) { $files = [System.Windows.Forms.Clipboard]::GetFileDropList()
Write-Host "Clipboard contains: $files" if ($files.Contains("$PWD\ctx.txt")) {
if ($files.Name -contains "ctx.txt") { exit 0 } Write-Host "Success: Clipboard contains ctx.txt"
exit 0
} }
Write-Error "Clipboard did not contain ctx.txt" Write-Error "Clipboard did not contain ctx.txt. Found: $files"
exit 1 exit 1