mirror of
https://github.com/skidoodle/ctx.git
synced 2026-04-28 11:17:42 +02:00
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:
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user