Skip to content

Messagebroker feature #1309

Messagebroker feature

Messagebroker feature #1309

Workflow file for this run

name: FastAPI backend with SQLite
permissions: {}
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: astral-sh/setup-uv@v5
- name: Install backend
run: uv sync --package acidwatch-api
- name: Run ruff
run: |
uv run --package acidwatch-api ruff format --check src tests packages ../workers
uv run --package acidwatch-api ruff check src tests packages ../workers
- name: Run mypy
run: uv run --package acidwatch-api mypy --strict src packages/acidwatch-models/src packages/acidwatch-messaging/src packages/acidwatch-messaging/typecheck packages/acidwatch-worker-runtime/src
- name: Run pytest
run: |
cp .env.example .env
uv run --package acidwatch-api pytest tests
worker-packages:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- package: acidwatch-worker-example
test_path: workers/example/tests
- package: acidwatch-worker-tocomo
test_path: workers/tocomo/tests
- package: acidwatch-worker-arcs
test_path: ""
- package: acidwatch-worker-arcs-exp
test_path: workers/arcs-exp/tests
- package: acidwatch-worker-solubilityccs
test_path: ""
- package: acidwatch-worker-gibbs-minimization
test_path: workers/gibbs-minimization/tests
- package: acidwatch-worker-phpitz-reactive
test_path: ""
- package: acidwatch-worker-phpitz-solubility
test_path: ""
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: astral-sh/setup-uv@v5
- name: Install worker
run: uv sync --package ${{ matrix.package }}
- name: Build worker package
run: uv build --package ${{ matrix.package }}
- name: Install Tocomo calculation package
if: matrix.package == 'acidwatch-worker-tocomo'
run: uv pip install --no-deps "git+https://github.com/equinor/tocomo@74e23131bd27d63dcf71b4a62eb81cdb76d981c9#subdirectory=backend"
- name: Test worker
if: matrix.test_path != ''
run: uv run --package ${{ matrix.package }} pytest ${{ matrix.test_path }}