-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (59 loc) · 1.59 KB
/
server-tests.yml
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
name: Run Server Tests
on:
push:
branches:
- development
- main
paths:
- "Tekst-API/tekst/**"
- "Tekst-API/tests/**"
- "Tekst-API/pyproject.toml"
- "Tekst-API/poetry.lock"
- ".github/workflows/server-tests.yml"
pull_request:
branches:
- development
paths:
- "Tekst-API/tekst/**"
- "Tekst-API/tests/**"
- "Tekst-API/pyproject.toml"
- "Tekst-API/poetry.lock"
- ".github/workflows/server-tests.yml"
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
services:
mongo:
image: mongo:7
ports:
- 27017:27017
mailpit:
image: axllent/mailpit:v1.20
ports:
- 1025:1025
env:
MP_SMTP_AUTH_ACCEPT_ANY: true
MP_SMTP_AUTH_ALLOW_INSECURE: true
defaults:
run:
working-directory: ./Tekst-API
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
cache-dependency-path: "./Tekst-API/poetry.lock"
- name: Install dependencies
run: poetry install --sync
- name: Cancel on setup error
if: failure()
uses: andymckay/[email protected]
- name: Run tests
if: always()
run: TEKST_DEV_MODE=true TEKST_CUSTOM_ENV_FILE=.env.test TEKST_EMAIL__SMTP_STARTTLS=false poetry run coverage run -m pytest && poetry run coverage lcov
- name: Coveralls
uses: coverallsapp/github-action@v2