diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 3b4e38e48..000000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: 🧪✨ Test coverage ✨🧪 - -on: - workflow_call: - workflow_dispatch: # Runs on manual calls - schedule: - - cron: "0 0 * * *" # Runs automatically every day - pull_request: - -# Allow concurrent runs on main/release branches but isolates other branches -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }} - cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }} - -jobs: - test-coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.19 - cache: true - - - name: Run all unit tests. - run: make test-coverage-integration - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c67e9817c..d61d98753 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -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"] @@ -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 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ff6c7b9ad..53b562f06 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -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 diff --git a/contrib/make/test.mk b/contrib/make/test.mk index e75564e3e..d9fc65558 100644 --- a/contrib/make/test.mk +++ b/contrib/make/test.mk @@ -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"