Update README.md. #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test & lint | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test-lint: | |
name: Test and Lint | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Lint | |
run: > | |
docker-compose --env-file .dev.env run --rm django sh -c | |
"cd backend && pylint src | |
--rcfile=/home/backend-user/app/.pylintrc | |
--load-plugins pylint_django | |
--django-settings-module=config.settings | |
--output-format=colorized" | |
- name: Run tests and measure code coverage | |
run: > | |
docker-compose --env-file .dev.env | |
run --rm django sh -c "python ./backend/manage.py wait_for_db && | |
coverage run -m pytest ./backend" | |
- name: Publish coverage results via coveralls.io. | |
run: > | |
echo "COVERALLS_REPO_TOKEN=${{secrets.COVERALLS_REPO_TOKEN}}" >> .dev.env && | |
docker-compose --env-file .dev.env | |
run --rm django sh -c "coveralls" |