build(deps): bump jinja2 from 3.1.4 to 3.1.5 in /api #387
Workflow file for this run
This file contains 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: Python CI | |
on: ["pull_request", "push"] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
poetry-version: [1.8.2] | |
services: | |
postgres: | |
image: postgres:16.3 | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: misp | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
opensearch: | |
image: opensearchproject/opensearch:1.3.16 | |
ports: | |
- 9200:9200 | |
- 9300:9300 | |
env: | |
OPENSEARCH_HOSTNAME: localhost | |
OPENSEARCH_PORT: 9200 | |
OPENSEARCH_INITIAL_ADMIN_PASSWORD: ;pnNZC+$#&5Af%' | |
cluster.name: opensearch-cluster | |
node.name: opensearch-misp1 | |
discovery.type: single-node | |
bootstrap.memory_lock: true | |
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m" | |
plugins.security.disabled: true | |
redis: | |
image: redis:7-alpine | |
ports: | |
- 6379:6379 | |
rabbitmq: | |
image: rabbitmq:3-management | |
ports: | |
- 15672:15672 | |
- 5672:5672 | |
env: | |
RABBITMQ_DEFAULT_VHOST: rabbitmq | |
RABBITMQ_DEFAULT_USER: rabbitmq | |
RABBITMQ_DEFAULT_PASS: rabbitmq | |
mailhog: | |
image: mailhog/mailhog | |
ports: | |
- 1025:1025 | |
- 8025:8025 | |
modules: | |
image: ghcr.io/misp/misp-docker/misp-modules:latest | |
ports: | |
- 6666:6666 | |
env: | |
REDIS_BACKEND: redis | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
env: | |
PYTHONDONTWRITEBYTECODE: 1 | |
with: | |
version: ${{ matrix.poetry-version }} | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
virtualenvs-path: ~/.virtualenvs | |
# - name: Load cached venv | |
# id: cached-poetry-dependencies | |
# uses: actions/cache@v2 | |
# with: | |
# path: api | |
# key: venv2-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}-${{ hashFiles('api/poetry.lock') }} | |
- name: Install dependencies | |
working-directory: api | |
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
env: | |
PYTHONDONTWRITEBYTECODE: 1 | |
run: poetry install --no-interaction --no-root | |
- name: Run DB migrations | |
working-directory: api | |
run: | | |
poetry run alembic upgrade head | |
env: | |
POSTGRES_HOSTNAME: localhost | |
POSTGRES_PORT: 5432 | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_DB: misp | |
OPENSEARCH_HOSTNAME: localhost | |
OPENSEARCH_PORT: 9200 | |
- name: Run tests | |
working-directory: api | |
run: | | |
poetry run pytest | |
env: | |
POSTGRES_HOSTNAME: localhost | |
POSTGRES_PORT: 5432 | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
POSTGRES_DB: misp | |
OPENSEARCH_HOSTNAME: localhost | |
OPENSEARCH_PORT: 9200 | |
OAUTH2_SECRET_KEY: e6d14a781f168c29f8ba7dad72c2ad1418375ab9e3878ea671ba87cf76618511 | |
OAUTH2_ALGORITHM: HS256 | |
OAUTH2_ACCESS_TOKEN_EXPIRE_MINUTES: 30 | |
CELERY_BROKER_URL: amqp://rabbitmq:rabbitmq@localhost:5672/rabbitmq | |
CELERY_RESULT_BACKEND: redis://localhost:6379/0 | |
MAIL_USERNAME: mail-user | |
MAIL_PASSWORD: mail-pwd | |
MAIL_PORT: 1025 | |
MAIL_SERVER: localhost | |
MODULES_HOST: localhost | |
MODULES_PORT: 6666 |