From bc6fa65a599e2c478cdbd6c66944ae530fe66323 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Fri, 6 Dec 2024 17:21:32 +0100 Subject: [PATCH] separate stages on github to view timings --- .github/workflows/push.yml | 6 ++++++ Makefile | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 3d60bd52f..2198ddaee 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -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 diff --git a/Makefile b/Makefile index 3265672e1..b154209d7 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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