diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72974af..6b10cad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v4 @@ -24,6 +24,27 @@ jobs: - name: Use Exiftool uses: woss/exiftool-action@v12.92 + if: matrix.os != 'windows-latest' + + - name: Install winget + uses: Cyberboss/install-winget@v1 + if: matrix.os == 'windows-latest' + + - name: Install Exiftool + run: winget install exiftool --disable-interactivity --accept-source-agreements + if: matrix.os == 'windows-latest' + + - name: Set up gotestfmt + run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest - name: Run tests - run: go test ./... -race + run: go test ./... -json -v -race 2>&1 | tee /tmp/gotest.log | gotestfmt + + # Upload the original go test log as an artifact for later review. + - name: Upload test log + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-log + path: /tmp/gotest.log + if-no-files-found: error diff --git a/app/app_test/app_unix_test.go b/app/app_test/app_unix_test.go index 2a71a17..b74d4bd 100644 --- a/app/app_test/app_unix_test.go +++ b/app/app_test/app_unix_test.go @@ -68,8 +68,15 @@ func TestPipingInputFromFind(t *testing.T) { }, }, { - name: "find a.txt and b.txt files", - findArgs: []string{"testdata", "-regex", `.*\/\(a\|b\)\.txt$`}, + name: "find a.txt and b.txt files", + findArgs: []string{ + "testdata", + "-name", + "a.txt", + "-o", + "-name", + "b.txt", + }, expected: []string{ "testdata/a.txt", "testdata/b.txt", diff --git a/replace/replace_test/variables_test.go b/replace/replace_test/variables_test.go index b131f6c..6038032 100644 --- a/replace/replace_test/variables_test.go +++ b/replace/replace_test/variables_test.go @@ -267,7 +267,7 @@ func TestVariables(t *testing.T) { "-f", ".*", "-r", - "{btime.YYYY}-{ctime.MM}-{now.DD}{ext}", + "{now.YYYY}-{ctime.MM}-{btime.DD}{ext}", }, }, { diff --git a/validate/validate_test/validate_unix_test.go b/validate/validate_test/validate_unix_test.go index a2759a6..c88abbd 100644 --- a/validate/validate_test/validate_unix_test.go +++ b/validate/validate_test/validate_unix_test.go @@ -1,3 +1,6 @@ +//go:build !windows +// +build !windows + package validate_test import (