diff --git a/.github/workflows/test_dev.yml b/.github/workflows/test_dev.yml new file mode 100644 index 0000000..94ca4d0 --- /dev/null +++ b/.github/workflows/test_dev.yml @@ -0,0 +1,42 @@ +name: Django Tests + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + cd backend + pip install -r requirements.txt + + - name: Run migrations + run: | + cd backend + python manage.py migrate + + - name: Run tests + run: | + cd backend + python manage.py test tests + + - name: Upload coverage reports + uses: codecov/codecov-action@v4 + with: + file: ./backend/coverage.xml + fail_ci_if_error: true