Skip to content

Merge branch 'trunk' into dependabot/github_actions/docker/login-acti… #27

Merge branch 'trunk' into dependabot/github_actions/docker/login-acti…

Merge branch 'trunk' into dependabot/github_actions/docker/login-acti… #27

Workflow file for this run

name: "Continuous Integration"
on:
workflow_dispatch:
push:
branches:
- "feature/**"
- "fix/**"
- "release/v*.*.*"
- "dependabot/**"
env:
ACCESS_LOGGER: ${{ secrets.ACCESS_LOGGER }}
ALL_HEADERS: ${{ secrets.ALL_HEADERS }}
API_PREFIX: ${{ secrets.API_PREFIX }}
APP_ENV: ${{ secrets.APP_ENV }}
APP_VERSION: ${{ secrets.APP_VERSION }}
ASGI_LOGGER: ${{ secrets.ASGI_LOGGER }}
DOCS_URL: ${{ secrets.DOCS_URL }}
IS_ALLOWED_CREDENTIALS: ${{ secrets.IS_ALLOWED_CREDENTIALS }}
METHOD_1: ${{ secrets.METHOD_1 }}
METHOD_2: ${{ secrets.METHOD_2 }}
METHOD_3: ${{ secrets.METHOD_3 }}
METHOD_4: ${{ secrets.METHOD_4 }}
METHOD_5: ${{ secrets.METHOD_5 }}
OPENAPI_URL: ${{ secrets.OPENAPI_URL }}
REDOC_URL: ${{ secrets.REDOC_URL }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
SERVER_HOST: ${{ secrets.SERVER_HOST }}
SERVER_PORT: ${{ secrets.SERVER_PORT }}
SERVER_WORKERS: ${{ secrets.SERVER_WORKERS }}
jobs:
build:
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.12.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install package and dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
pip3 install .
code-quality:
needs: build
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.12.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install linting dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip3 install ".[linter]"
- name: Lint with Black
working-directory: ./src
run: |
black --config=../pyproject.toml .
- name: Lint with Isort
working-directory: ./src
run: |
isort --settings-path=../pyproject.toml .
- name: Lint with MyPy
working-directory: ./src
run: |
mypy --config-file=../pyproject.toml --pretty .
security:
needs: code-quality
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.12.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install testing dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip3 install ".[security]"
- name: Test application's vulnerability with bandit
working-directory: ./src
run: |
bandit -c ../pyproject.toml -r .
test:
needs: code-quality
strategy:
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.12.0"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install testing dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip3 install ".[test]"
- name: Test with Pytest and Coverage
run: |
pytest --cov --cov-report xml .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: pleno_rapid_assessment
name: codecov-umbrella
verbose: true