Skip to content

Commit

Permalink
test: adding codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
WesGtoX committed Mar 28, 2021
1 parent 144f4ac commit 6bf5e41
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
name: Resume CI

on: pull_request
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Build the Docker image
run: docker-compose build --no-cache
- name: Build the Docker image
run: docker-compose build --no-cache

- name: Run tests
run: docker-compose run --rm api pytest
- name: Run tests and upload coverage to Codecov
run: |
ci_env="bash <(curl -s https://codecov.io/env)"
ci_post_cov="bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}"
docker-compose run -e CI=true --rm api bash -c "$ci_env && pytest && $ci_post_cov"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local_settings.py
db.sqlite3
db.sqlite3-journal
media
static

# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
# in your Git repository. Update and uncomment the following line accordingly.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ENV DJANGO_ENV=${DJANGO_ENV} \
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
# deps for installing poetry
curl \
curl git mercurial \
# deps for building python deps
build-essential \
# cleaning cache
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DJANGO_SETTINGS_MODULE = api.settings
testpaths = .
python_files = tests.py test_*.py *_tests.py
addopts = --flake8 -vv -s
addopts = --flake8 -vv -s --cov=. --cov-report=html
flake8-ignore =
*.py E501
*/migrations/*.py ALL

0 comments on commit 6bf5e41

Please sign in to comment.