Skip to content

Commit

Permalink
fix run_tests.yml and Makefi
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrKosmylev committed Apr 13, 2024
1 parent b906add commit 62997c2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tests_coverage
name: run_tests

on:
- push
Expand All @@ -7,34 +7,37 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.10.12]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v3

- name: Install python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# make depends on poetry
python-version: 3.11

- name: Install dependencies
run: |
pip install poetry
make install
- name: Run linter
run: |
make lint
- name: Run tests
env:
DATABASE_URL: sqlite:///db.sqlite3
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
make test
- name: Test & publish code coverage
make test_coverage
- name: Run code coverage
uses: paambaati/codeclimate-action@v5.0.0
if: github.ref_name == 'main'
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
DATABASE_URL: sqlite:///db.sqlite3
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
with:
coverageCommand: make test-coverage
coverageCommand: make test_coverage
debug: true

- name: Run linter
run: make lint
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ test:
run:
python manage.py runserver

test-coverage:
poetry run coverage run ./manage.py test
poetry run coverage xml
test_coverage:
poetry run coverage run manage.py test
poetry run coverage report -m --include=task_manager/* --omit=task_manager/settings.py
poetry run coverage xml --include=task_manager/* --omit=task_manager/settings.py

0 comments on commit 62997c2

Please sign in to comment.