-
Notifications
You must be signed in to change notification settings - Fork 7
91 lines (77 loc) · 1.96 KB
/
ci.yml
File metadata and controls
91 lines (77 loc) · 1.96 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
88
89
90
91
name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
lint-and-unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
requirements.txt
requirements-dev.txt
setup.py
pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Ruff
run: ruff check .
- name: Unit tests
run: pytest -q
integration:
runs-on: ubuntu-latest
needs: lint-and-unit
services:
core:
image: datarhei/core:latest
ports:
- 8080:8080
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: |
requirements.txt
requirements-dev.txt
setup.py
pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
- name: Wait for Core
run: |
for i in {1..60}; do
if curl -fsS http://127.0.0.1:8080/api > /dev/null; then
exit 0
fi
sleep 1
done
echo "Core service not ready in time"
exit 1
- name: Integration tests (no cluster)
env:
RUN_INTEGRATION_TESTS: "1"
CORE_URL: "http://127.0.0.1:8080"
run: pytest -q tests