Skip to content

ci(codecov): integrated codecov #16

ci(codecov): integrated codecov

ci(codecov): integrated codecov #16

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
jobs:
build-and-test-in-containerized:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3
- name: Create .env file
uses: SpicyPizza/create-envfile@v1.3
with:
envkey_SECRET_KEY: ${{ secrets.SECRET_KEY }}
envkey_ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }}
envkey_DB_ENGINE: ${{ secrets.DB_ENGINE }}
envkey_CHANNEL_LAYER_BACKEND: ${{ secrets.CHANNEL_LAYER_BACKEND }}
envkey_REDIS_SERVER: ${{ secrets.REDIS_SERVER }}
envkey_REDIS_PORT: ${{ secrets.REDIS_PORT }}
- name: Build image with docker compose
run: docker compose build --no-cache
- name: Run test
run: docker compose run --rm backend pytest
build-and-test-on-host:
runs-on: ubuntu-latest
steps:
- name: Checkout codebase
uses: actions/checkout@v3
- name: Create .env file
uses: SpicyPizza/create-envfile@v1.3
with:
envkey_SECRET_KEY: ${{ secrets.SECRET_KEY }}
envkey_ALLOWED_HOSTS: ${{ secrets.ALLOWED_HOSTS }}
envkey_DB_ENGINE: ${{ secrets.DB_ENGINE }}
envkey_CHANNEL_LAYER_BACKEND: ${{ secrets.CHANNEL_LAYER_BACKEND }}
envkey_REDIS_SERVER: ${{ secrets.REDIS_SERVER }}
envkey_REDIS_PORT: ${{ secrets.REDIS_PORT }}
- name: Install project dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Run test
run: |
pytest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3