-
Notifications
You must be signed in to change notification settings - Fork 4
118 lines (111 loc) · 3.32 KB
/
test.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Test
on:
push:
branches:
- develop
- master
pull_request:
workflow_dispatch:
jobs:
python-test:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install graphviz
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "pip"
- name: Install Deps
run: pip install -r nereid/requirements/requirements_dev.txt
- name: Run Tests
run: |
pytest nereid/nereid/tests/test_src -v -n auto --cov=nereid/nereid/src
coverage report -m --omit=*test* --fail-under=100
python-test-install:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- run: sudo apt-get install graphviz
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install nereid as library
run: |
pip install .
- name: Test Import
run: python -c "from nereid.src import tasks"
- name: Run Tests
run: |
pip install .[test]
pytest nereid/nereid/tests/test_src -v -n auto
python-edge-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- run: sudo apt-get install graphviz
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install Edge Deps
run: |
pip install --upgrade pip
awk -F"==" '{print $1}' \
nereid/requirements/requirements_dev.txt > nereid/requirements_edge.txt
pip install -r nereid/requirements_edge.txt
- name: Run Edge Tests
continue-on-error: true
run: |
pytest nereid/nereid/tests -xv -n auto
- name: Exit
run: exit 0
test:
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker-stack.yml
steps:
- uses: actions/checkout@v4
- name: build stack
run: |
docker --version
make develop
make init-test
- name: run docker coverage
run: |
docker compose exec -T nereid-tests pytest nereid/tests -s -n auto --cov=nereid/
docker compose exec -T nereid-tests pytest nereid/tests/test_api -s -n auto --cov=nereid/ --cov-append --async
docker compose exec -T nereid-tests coverage report -m
docker compose exec -T nereid-tests coverage xml
docker compose exec -T nereid-tests cat coverage.xml > ./nereid/coverage.xml
- name: upload coverage
uses: codecov/codecov-action@v3
with:
directory: ./nereid/
test-edge:
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker-stack.yml
steps:
- uses: actions/checkout@v4
- name: build stack
run: |
docker --version
bash ./scripts/build_edge.sh
docker compose build
make init-test
- name: run edge tests
continue-on-error: true
run: docker compose exec -T nereid-tests pytest -v -n auto
- name: Exit
run: exit 0