Skip to content

Commit

Permalink
separate stages on github to view timings
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Dec 6, 2024
1 parent a1dad68 commit bc6fa65
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ jobs:
make vendor
pip3 install wheel
- name: Build changecalc
run: make changecalc/changecalc

- name: Calculate affected packages
run: make viewchanges

- name: Run tests
run: make testchanges

Expand Down
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ testonly:
@echo "✓ Running tests ..."
@gotestsum --format pkgname-and-test-fails --no-summary=skipped --raw-command go test -v -json -short -coverprofile=coverage.txt ./...

viewchanges: changecalc/changecalc
@changecalc/changecalc
viewchanges: affected-packages.txt
@cat affected-packages.txt

testchanges: changecalc/changecalc
@echo "✓ Running tests based on changes relative to main..."
changecalc/changecalc > changed-packages.txt || echo "./..." > 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
affected-packages.txt: changecalc/changecalc
changecalc/changecalc > affected-packages.txt || echo "./..." > affected-packages.txt

testchanges: affected-packages.txt
xargs gotestsum --format pkgname-and-test-fails --no-summary=skipped --raw-command go test -v -json -short -coverprofile=coverage.txt < affected-packages.txt

changecalc/changecalc: changecalc/*.go
@go build -o changecalc/changecalc changecalc/main.go
Expand All @@ -48,4 +49,4 @@ vendor:
@go mod vendor


.PHONY: build vendor coverage test lint fmt viewchanges testchanges
.PHONY: build vendor coverage test lint fmt viewchanges testchanges affected-packages.txt

0 comments on commit bc6fa65

Please sign in to comment.