From b7118b2c4fdc9f29063df06bbd969b8ef3533d7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=BCller?= Date: Mon, 18 Mar 2024 16:54:41 -0700 Subject: [PATCH] feat: adding django tests to github action analysis (#108) * adding django tests to github action analysis * path fix * adding env parameters * fixed env --- .github/workflows/analysis.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index b4730565..a4b0a1ef 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -53,9 +53,36 @@ jobs: with: sarif_file: "trivy-results.sarif" + tests: + name: Django Tests + if: ${{ ! github.event.pull_request.draft }} + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: frontend + env: + DEBUG: "False" + ALLOWED_HOSTS: 'localhost,' + CSRF_TRUSTED_ORIGINS: 'http://localhost,https://localhost' + SECRET_KEY: 'temporary_debug_key' + timeout-minutes: 15 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install requirements + run: | + pip install -r requirements.txt + - name: Run tests + run: | + python manage.py test + results: name: Analysis Results - needs: [codeql, trivy] + needs: [codeql, trivy, tests] runs-on: ubuntu-22.04 steps: - run: echo "Workflow completed successfully!"