From f3a4cd82fd24d512dfcdefbc8d1ef4c65d48687d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauritz=20Skog=C3=B8y?= Date: Thu, 27 Mar 2025 14:13:02 +0100 Subject: [PATCH] Test: added workflow files for testing --- .github/workflows/test_dev.yml | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/test_dev.yml 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