Skip to content

Commit

Permalink
refactor(gha): simplify integration test workflows (#1591)
Browse files Browse the repository at this point in the history
* chore(gha): simplify test workflows

* chore: remove coverage workflow
  • Loading branch information
k-yang authored Sep 18, 2023
1 parent ab60e8c commit 782fb5c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 43 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/coverage.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Integration tests

on:
workflow_dispatch: # Runs on manual calls
schedule:
- cron: "0 0 * * *" # Runs automatically every day
pull_request:
# paths makes the action run only when the given paths are changed
paths: ["**.go", "**.proto", "go.mod", "go.sum"]
Expand All @@ -24,4 +27,7 @@ jobs:
cache: true

- name: Run all integration tests.
run: make test-integration
run: make test-coverage-integration

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
cache: true

- name: Run all unit tests.
run: make test-unit
run: make test-coverage

build:
runs-on: ubuntu-latest
Expand Down
12 changes: 2 additions & 10 deletions contrib/make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,17 @@

PACKAGES_NOSIMULATION = ${shell go list ./... | grep -v simapp}

.PHONY: test-unit
test-unit:
go test -v $(PACKAGES_NOSIMULATION) -short -coverprofile=coverage.txt -covermode=count

.PHONY: test-integration
test-integration:
go test -v $(PACKAGES_NOSIMULATION) -coverprofile=coverage.txt -covermode=count

# Used for CI by Codecov
.PHONY: test-coverage
test-coverage:
go test ./... -short \
go test ./... -v $(PACKAGES_NOSIMULATION) -short \
-coverprofile=coverage.txt \
-covermode=atomic \
-race | grep -v "no test" | grep -v "no statement"

.PHONY: test-coverage-integration
test-coverage-integration:
go test ./... \
go test ./... -v $(PACKAGES_NOSIMULATION) \
-coverprofile=coverage.txt \
-covermode=atomic \
-race | grep -v "no test" | grep -v "no statement"
Expand Down

0 comments on commit 782fb5c

Please sign in to comment.