-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (68 loc) · 2.45 KB
/
Copy pathpython.yaml
File metadata and controls
87 lines (68 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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 }}