[ORG-108] Get answers for an application #169
Workflow file for this run
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: π©π»βπ»π¦ Organizator API CI | |
defaults: | |
run: | |
working-directory: ./organizator_api | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/organizator_api_ci.yml' | |
- 'organizator_api/**' | |
- '!organizator/**' | |
branches: [ master ] | |
workflow_dispatch: | |
env: | |
DEBUG: 1 | |
IMAGE_TAG: ${{ github.job }}-${{ github.sha }} | |
jobs: | |
linter: | |
name: π¦ Linter | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.9" ] | |
steps: | |
- name: π Setup repo | |
uses: actions/checkout@v3 | |
- name: π¦ Run type checks | |
run: docker-compose -f ../docker-compose.yaml run --rm --no-deps api mypy . --cache-dir=/dev/null | |
- name: π¦ Run linting | |
run: docker-compose -f ../docker-compose.yaml run --rm --no-deps api black . --check --verbose | |
- name: π Remove running containers | |
run: docker-compose -f ../docker-compose.yaml down | |
test: | |
name: π€ Test and coverage | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.9" ] | |
steps: | |
- name: π Setup repo | |
uses: actions/checkout@v3 | |
- name: π¦ Run dev migrations | |
run: docker-compose -f ../docker-compose.yaml run --rm api python manage.py migrate | |
- name: π§ͺ Run tests | |
run: docker-compose -f ../docker-compose.yaml run --rm api coverage run --source='./app' manage.py test | |
- name: π Generate test coverage xml | |
run: | | |
docker-compose -f ../docker-compose.yaml run --rm --no-deps api coverage xml | |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE | |
sed -i 's/<source>\/code<\/source>/<source>organizator_api<\/source>/g' coverage.xml | |
- name: π Publish coverage report in PR comment | |
uses: orgoro/coverage@v3 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
coverageFile: organizator_api/coverage.xml | |
thresholdAll: 0.9999 | |
thresholdNew: 0.9999 | |
thresholdModified: 0.9999 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: π Remove running containers | |
run: docker-compose -f ../docker-compose.yaml down |