From 6c8edf6a3af3272ec8b767de657ede5e90c565e3 Mon Sep 17 00:00:00 2001 From: Trinkle23897 <463003665@qq.com> Date: Tue, 7 Apr 2020 11:17:10 +0800 Subject: [PATCH] codecov badge --- .github/workflows/pytest.yml | 17 ++++++++++------- README.md | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 538a6c387..10a1551bb 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -3,15 +3,10 @@ name: Unittest -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest strategy: matrix: @@ -32,4 +27,12 @@ jobs: flake8 . --count --show-source --statistics - name: Test with pytest run: | - pytest test --cov tianshou + pytest test --cov tianshou --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV }} + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + fail_ci_if_error: false diff --git a/README.md b/README.md index fe4f2b91e..bd57171f1 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![PyPI](https://img.shields.io/pypi/v/tianshou)](https://pypi.org/project/tianshou/) [![Unittest](https://github.com/thu-ml/tianshou/workflows/Unittest/badge.svg?branch=master)](https://github.com/thu-ml/tianshou/actions) +[![codecov](https://codecov.io/gh/thu-ml/tianshou/graph/badge.svg)](https://codecov.io/gh/thu-ml/tianshou) [![Documentation Status](https://readthedocs.org/projects/tianshou/badge/?version=latest)](https://tianshou.readthedocs.io) [![GitHub issues](https://img.shields.io/github/issues/thu-ml/tianshou)](https://github.com/thu-ml/tianshou/issues) [![GitHub stars](https://img.shields.io/github/stars/thu-ml/tianshou)](https://github.com/thu-ml/tianshou/stargazers)