-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 1.65 KB
/
Tests.yaml
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
name: Tests
on:
pull_request:
paths:
- "backend/**"
push:
branches: [main]
env:
POSTGRES_URI: "postgresql+psycopg://nautilus:nautilus@localhost:5432/nautilus"
S3_URL_WITH_CREDENTIALS: "PLACEHOLDER"
PRIVATE_KEY: "PRIVATE_KEY"
jobs:
run-tests:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:15.3-bullseye
env:
POSTGRES_PASSWORD: nautilus
POSTGRES_DB: nautilus
POSTGRES_PORT: 5432
POSTGRES_USER: nautilus
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version-file: "backend/pyproject.toml"
architecture: x64
- name: Install dependencies (and project)
working-directory: backend
run: |
pip install -U pip
pip install -e .[test,scripts]
- name: Initialize the database
working-directory: backend
run: |
alembic upgrade head
alembic check
- name: Run the tests
working-directory: backend
run: inv coverage --args "-vvv"
- name: Upload coverage to Codecov
if: matrix.python == '3.11'
uses: codecov/codecov-action@v3
with:
root_dir: backend
working-directory: backend
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Ensure we can build targets
working-directory: backend
run: |
pip install build
python3 -m build