Skip to content

Commit

Permalink
Added code cov
Browse files Browse the repository at this point in the history
  • Loading branch information
Attumm committed May 15, 2024
1 parent 722858e commit 4711b04
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@ on:
permissions:
contents: read

env:
PYTHON_VERSIONS: '["3.8", "3.9", "3.10", "3.11", "3.12"]'

jobs:
build:
runs-on: ${{ matrix.os }}
services:
redis:
image: redis
ports:
- 6379:6379
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ${{fromJson(env.PYTHON_VERSIONS)}}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set MAX_PYTHON_VERSION env variable
run: |
echo "MAX_PYTHON_VERSION=$(echo '${{ env.PYTHON_VERSIONS }}' | jq -r '.[-1]')" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install --upgrade pip setuptools
Expand All @@ -41,9 +43,11 @@ jobs:
- name: Run Pylama
run: |
pylama * -i E501
# - name: Run MyPy strict
# run: |
# mypy --strict
- name: Run Unit Tests
run: |
python -m unittest discover
coverage run -m unittest discover
- name: Upload coverage reports to Codecov
if: env.MAX_PYTHON_VERSION == matrix.python-version
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pylama==8.4.1
coverage==7.5.1

0 comments on commit 4711b04

Please sign in to comment.