Skip to content

Commit

Permalink
change test.yml and makefile (cosmos#968)
Browse files Browse the repository at this point in the history
## Overview

The Code Coverage action appears to be broken, this is an attempt to fix
it.

Fix inspired by
https://github.com/celestiaorg/celestia-node/pull/2249/files

## Checklist

- [ ] New and updated code has appropriate documentation
- [ ] New and updated code has new and/or updated testing
- [ ] Required CI checks are passing
- [ ] Visual proof for any user facing features like CLI or
documentation updates
- [ ] Linked issues closed with keywords

---------

Co-authored-by: Connor O'Hara <[email protected]>
  • Loading branch information
S1nus and Connor O'Hara authored Jun 2, 2023
1 parent 8b1f9b4 commit 30265e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# - name: check for diff
# run: git diff --exit-code

test_coverage:
unit_test:
name: Unit Tests Coverage
runs-on: ubuntu-latest
steps:
Expand All @@ -32,23 +32,13 @@ jobs:
with:
go-version: ${{ inputs.GO_VERSION }}
- name: Test & Coverage
run: make cover
- uses: codecov/[email protected]
run: make test-unit
- name: upload coverage
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt

unit_test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up go
uses: actions/setup-go@v4
with:
go-version: ${{ inputs.GO_VERSION }}
- name: execute test run
run: make test-unit

unit_race_test:
name: Run Unit Tests with Race Detector
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lint:
## test-unit: Running unit tests
test-unit:
@echo "--> Running unit tests"
@go test `go list ./...`
@go test -covermode=atomic -coverprofile=coverage.txt `go list ./...`
.PHONY: test-unit

## test-unit-race: Running unit tests with data race detector
Expand Down

0 comments on commit 30265e0

Please sign in to comment.