feat: export audit as powerpoint deck #6211
This file contains hidden or 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: Backend code coverage | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| paths: | |
| - "backend/**" | |
| # Cancel older in-progress runs for the same PR or the same ref (branch) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| GITHUB_WORKFLOW: github_actions | |
| POSTGRES_VERSION: "16" | |
| UBUNTU_VERSION: "ubuntu-24.04" | |
| PYTHON_VERSION: "3.12" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| backend-directory: ./backend | |
| DJANGO_DEBUG: "True" | |
| POSTGRES_NAME: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| DB_HOST: localhost | |
| EMAIL_HOST: localhost | |
| EMAIL_PORT: 1025 | |
| EMAIL_HOST_USER: "" | |
| EMAIL_HOST_PASSWORD: "" | |
| DEFAULT_FROM_EMAIL: "[email protected]" | |
| CISO_ASSISTANT_SUPERUSER_EMAIL: "" | |
| CISO_ASSISTANT_URL: http://127.0.0.1:5173 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres # test credential | |
| POSTGRES_DB: postgres | |
| ports: ["5432:5432"] | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Install Poetry via pipx | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade pipx | |
| python -m pipx ensurepath | |
| echo "$HOME/.local/bin" >> "$GITHUB_PATH" | |
| python -m pipx install poetry | |
| - name: Check Poetry version | |
| shell: bash | |
| run: poetry --version | |
| - name: Install backend requirements | |
| working-directory: ${{ env.backend-directory }} | |
| run: poetry install | |
| - name: Run migrations | |
| working-directory: ${{ env.backend-directory }} | |
| run: poetry run python manage.py migrate | |
| - name: Run coverage | |
| working-directory: ${{ env.backend-directory }} | |
| env: | |
| DATABASE_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres" | |
| run: poetry run coverage run -m pytest | |
| - name: Display coverage report | |
| working-directory: ${{ env.backend-directory }} | |
| env: | |
| DATABASE_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres" | |
| run: poetry run coverage report |