From d90d19790dafc3ce410f3aee3600a0d66960e737 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 6 Dec 2024 16:52:36 +0100 Subject: [PATCH] Use xargs, $shell cat does not work on github runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run make testchanges cat: changed-packages.txt: No such file or directory ✓ Running tests based on changes relative to main... changecalc/changecalc > changed-packages.txt || echo "./..." > changed-packages.txt fatal: bad revision 'main' failed to execute [git diff main --name-only -- .]: exit status 128 gotestsum --format pkgname-and-test-fails --no-summary=skipped --raw-command go test -v -json -short -coverprofile=coverage.txt ✓ . (32ms) (coverage: 0.0% of statements) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index adfe25343..3265672e1 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ viewchanges: changecalc/changecalc testchanges: changecalc/changecalc @echo "✓ Running tests based on changes relative to main..." changecalc/changecalc > changed-packages.txt || echo "./..." > changed-packages.txt - gotestsum --format pkgname-and-test-fails --no-summary=skipped --raw-command go test -v -json -short -coverprofile=coverage.txt $(shell cat changed-packages.txt) + xargs gotestsum --format pkgname-and-test-fails --no-summary=skipped --raw-command go test -v -json -short -coverprofile=coverage.txt < changed-packages.txt changecalc/changecalc: changecalc/*.go @go build -o changecalc/changecalc changecalc/main.go