Use xargs, $shell cat does not work on github runner

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)
This commit is contained in:
Denis Bilenko 2024-12-06 16:52:36 +01:00
parent 0ff74ba6e3
commit d90d19790d
1 changed files with 1 additions and 1 deletions

View File

@ -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