Skip to content

Commit

Permalink
Merge pull request #138 from rst0git/ci-codecov
Browse files Browse the repository at this point in the history
ci: use codecov-action to upload coverage report
  • Loading branch information
rst0git authored Jul 19, 2024
2 parents ee4e4e3 + f76433c commit b1f1c3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ on: [push, pull_request]

jobs:
coverage:
if: ${{ github.repository == 'checkpoint-restore/checkpointctl' }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# needed for codecov
fetch-depth: 0
Expand All @@ -20,5 +21,11 @@ jobs:
sudo apt-get install -qqy criu
- name: Run make coverage
run: sudo -E make coverage
- name: Run make codecov
run: make codecov

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
file: .coverage/coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ coverage: $(NAME).coverage
$(GO) tool covdata percent -i=${COVERAGE_PATH}
$(GO) tool covdata textfmt -i=${COVERAGE_PATH} -o ${COVERAGE_PATH}/coverage.out

.PHONY: codecov
codecov:
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -f "$(COVERAGE_PATH)"/coverage.out

.PHONY: vendor
vendor:
go mod tidy
Expand Down Expand Up @@ -139,7 +133,6 @@ help:
@echo " * test - run tests"
@echo " * test-junit - run tests and create junit output"
@echo " * coverage - generate test coverage report"
@echo " * codecov - upload coverage report to codecov.io"
@echo " * install - install the binary to $(BINDIR)"
@echo " * uninstall - remove the installed binary from $(BINDIR)"
@echo " * release - build a static binary"
Expand Down

0 comments on commit b1f1c3b

Please sign in to comment.