From c359e19a8d1384126322c390adb4ca27e2a3e335 Mon Sep 17 00:00:00 2001 From: Oleg Lobanov Date: Sun, 14 Mar 2021 12:28:59 +0100 Subject: [PATCH 1/2] Run tests on ubuntu and windows --- .github/workflows/main.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index cb4275d..1d56731 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,7 +22,10 @@ jobs: version: v1.37.1 skip-go-installation: true test: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: Set up Go @@ -30,8 +33,9 @@ jobs: with: go-version: 1.16 - name: Test - run: go test -race -timeout=60s -v -coverprofile=coverage.txt -covermode=atomic ./... + run: go test -race -timeout=60s -v -coverprofile="coverage.txt" -covermode=atomic ./... - uses: codecov/codecov-action@v1 + if: ${{ matrix.os == 'ubuntu-latest' }} with: file: ./coverage.txt release: From 51019ae84061d7c93724909c8e0285607f90c047 Mon Sep 17 00:00:00 2001 From: Oleg Lobanov Date: Sun, 14 Mar 2021 13:10:42 +0100 Subject: [PATCH 2/2] Fix assets path on windows --- govatar.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/govatar.go b/govatar.go index 042d9ac..ce3baa3 100644 --- a/govatar.go +++ b/govatar.go @@ -13,6 +13,7 @@ import ( "io/fs" "math/rand" "os" + "path" "path/filepath" "sort" "strings" @@ -175,7 +176,7 @@ func mustAssetsList(dir string) []string { } assets := make([]string, len(dirEntries)) for i, dirEntry := range dirEntries { - assets[i] = filepath.Join(dir, dirEntry.Name()) + assets[i] = path.Join(dir, dirEntry.Name()) } sort.Sort(naturalSort(assets)) return assets