-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (90 loc) · 2.69 KB
/
pytest.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: ci
on:
push:
branches:
- main
- renovate/*
tags:
- v*
pull_request:
branches:
- main
jobs:
mypy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: "Set up environment"
uses: packetcoders/action-setup-cache-python-poetry@0d0be5577b30d85f3fa2d93a4beeda149520f120 # v1.2.0
with:
# renovate: datasource=conda depName=conda-forge/python
python-version: "3.13.0"
# renovate: datasource=pypi depName=poetry versioning=pep440
poetry-version: "1.8.4"
install-args: --all-extras
- name: Install root
run: poetry run pip install -e . --no-deps
- run: |
poetry run mypy app
test:
runs-on: ubuntu-24.04
services:
mongo:
image: mongo:8
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: 12345
MONGODUMP_DIR: /mongodumps
volumes:
- ${{ github.workspace }}/mongodumps:/mongodumps
ports:
- 27017:27017
options: --name mongo
unit:
image: unit:1.33.0-python3.12-slim
volumes:
- ${{ github.workspace }}/unit:/www
ports:
- 80:80
options: --name unit
defaults:
run:
working-directory: "src"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
path: src
- name: "Set up environment"
uses: jvansanten/action-setup-cache-python-poetry@working-directory
with:
# renovate: datasource=conda depName=conda-forge/python
python-version: "3.13.0"
# renovate: datasource=pypi depName=poetry versioning=pep440
poetry-version: "1.8.4"
install-args: --all-extras
working-directory: src
- name: Install root
run: poetry run pip install -e . --no-deps
- name: Populate docker volumes
run: |
sudo cp -r . ${{ github.workspace }}/unit
sudo cp -r tests/test-data/minimongodumps/* ${{ github.workspace }}/mongodumps
- name: "Populate test catalog"
uses: docker://docker
with:
args: >
docker exec mongo /mongodumps/restore.sh
- name: "Configure Unit"
uses: docker://docker
with:
args: >
docker exec unit curl
http://localhost/config
--unix-socket /var/run/control.unit.sock
-X PUT -d @/www/tests/test-data/nginx-unit/config.json
--fail-with-body
- name: Test with pytest
run: |
poetry run pytest tests --integration
env:
CATALOGSERVER_URI: http://localhost:80