From 4aee7ad2d40c9a5511bbf47c44b764dacbf6ed4b Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Sun, 2 Oct 2022 22:08:01 +0200 Subject: [PATCH] Upload code coverage to codecov.io --- .../workflows/{pythoncheck.yml => check.yaml} | 5 ++--- .github/workflows/codecov.yaml | 20 +++++++++++++++++++ .../{pythonpublish.yml => publish.yaml} | 6 +++--- 3 files changed, 25 insertions(+), 6 deletions(-) rename .github/workflows/{pythoncheck.yml => check.yaml} (80%) create mode 100644 .github/workflows/codecov.yaml rename .github/workflows/{pythonpublish.yml => publish.yaml} (82%) diff --git a/.github/workflows/pythoncheck.yml b/.github/workflows/check.yaml similarity index 80% rename from .github/workflows/pythoncheck.yml rename to .github/workflows/check.yaml index 266cf36..ddaafac 100644 --- a/.github/workflows/pythoncheck.yml +++ b/.github/workflows/check.yaml @@ -7,9 +7,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: Lint with flake8 diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml new file mode 100644 index 0000000..aaaabbe --- /dev/null +++ b/.github/workflows/codecov.yaml @@ -0,0 +1,20 @@ +name: Code Coverage +on: + push: + pull_request: + branches: [ master ] +jobs: + coverage: + if: github.repository_owner == 'arkq' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Generate Coverage Report + run: | + pip install coverage + coverage run --include=src/* setup.py pytest + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/publish.yaml similarity index 82% rename from .github/workflows/pythonpublish.yml rename to .github/workflows/publish.yaml index 8c85802..cc3192b 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/publish.yaml @@ -5,11 +5,11 @@ on: - '*' jobs: deploy: + if: github.repository_owner == 'arkq' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install dependencies