-
Notifications
You must be signed in to change notification settings - Fork 96
89 lines (76 loc) · 2.04 KB
/
test.yaml
File metadata and controls
89 lines (76 loc) · 2.04 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
name: Test
on:
push:
branches:
- "**"
- "!gh-pages"
- "!stage*"
paths:
- "src/datajoint/**"
- "tests/**"
- "pyproject.toml"
- "docker-compose.yaml"
- ".github/workflows/test.yaml"
pull_request:
branches:
- "**"
- "!gh-pages"
- "!stage*"
paths:
- "src/datajoint/**"
- "tests/**"
- "pyproject.toml"
- "docker-compose.yaml"
- ".github/workflows/test.yaml"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py_ver: ["3.10", "3.11", "3.12", "3.13"]
mysql_ver: ["8.0"]
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y graphviz
- name: Start services
run: docker compose up -d db minio --wait
env:
MYSQL_VER: ${{ matrix.mysql_ver }}
- name: Set up Python ${{ matrix.py_ver }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_ver }}
- name: Install dependencies
run: pip install -e ".[test]"
- name: Run tests
env:
DJ_USE_EXTERNAL_CONTAINERS: "1"
DJ_HOST: 127.0.0.1
DJ_PORT: 3306
DJ_USER: root
DJ_PASS: password
S3_ENDPOINT: 127.0.0.1:9000
S3_ACCESS_KEY: datajoint
S3_SECRET_KEY: datajoint
run: pytest --cov-report term-missing --cov=datajoint tests -v
- name: Stop services
if: always()
run: docker compose down
# Unit tests run without containers (faster feedback)
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
py_ver: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.py_ver }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py_ver }}
- name: Install dependencies
run: pip install -e ".[test]"
- name: Run unit tests
run: pytest tests/unit -v