Skip to content

Commit

Permalink
fix codecov reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mego committed Jun 13, 2024
1 parent a1f2921 commit c0be9f8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
49 changes: 26 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,41 @@ name: Test

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest coverage codecov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest and report coverage with codecov
run: |
coverage run tests.py && codecov
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest coverage codecov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
coverage run tests.py
- name: Report coverage to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_API_TOKEN }}
1 change: 0 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
codecov:
token: 6d0d3f24-9591-4d98-8dd7-dfe2337b473
notify:
require_ci_to_pass: yes

Expand Down

0 comments on commit c0be9f8

Please sign in to comment.