-
Notifications
You must be signed in to change notification settings - Fork 36
83 lines (81 loc) · 3.07 KB
/
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Tests
on:
push:
branches:
- "master"
- "stable"
pull_request:
branches:
- "master"
- "stable"
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
env:
PGPORT: "5433"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run container
run: |
docker compose -f docker-compose.test.yml -f docker-compose.test.listen.yml up -d --build test
- name: Check dependencies
run: |
docker compose -f docker-compose.test.yml exec -T test ./scripts/check_deps_versions.sh --exit-code-from
- name: Validate dashboards
run: |
docker compose -f docker-compose.test.yml exec -T test python3.11 ./scripts/validate_dashboards.py ./monitoring/grafana/dashboards/ --exit-code-from
- name: Wait for services and upgrade DB
run: |
docker compose -f docker-compose.test.yml exec -T test python3.11 -m vmaas.common.wait_for_services python3.11 -m vmaas.reposcan.database.upgrade --exit-code-from
- name: exec common tests
run: |
docker compose -f docker-compose.test.yml exec -T test ./run_tests.sh vmaas/common --exit-code-from
docker compose -f docker-compose.test.yml cp test:/vmaas/vmaas/common/coverage.xml ./coverage_common.xml
- name: exec reposcan tests
run: |
docker compose -f docker-compose.test.yml exec -T test ./run_tests.sh vmaas/reposcan --exit-code-from
docker compose -f docker-compose.test.yml cp test:/vmaas/vmaas/reposcan/coverage.xml ./coverage_reposcan.xml
- name: exec webapp tests
run: |
docker compose -f docker-compose.test.yml exec -T test ./run_tests.sh vmaas/webapp --exit-code-from
docker compose -f docker-compose.test.yml cp test:/vmaas/vmaas/webapp/coverage.xml ./coverage_webapp.xml
- name: exec webapp-go tests
run: |
docker compose -f docker-compose.test.yml exec -T test ./run_tests.sh vmaas-go --exit-code-from
docker compose -f docker-compose.test.yml cp test:/vmaas/vmaas-go/coverage.txt ./coverage_webapp_go.txt
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage_common.xml,./coverage_reposcan.xml,./coverage_webapp.xml,./coverage_webapp_go.txt
verbose: true
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
run: |
pip install poetry~=1.5
poetry export --with dev -f requirements.txt --output requirements.txt
pip install -r requirements.txt
- name: Run flake8
run: |
flake8 vmaas/
- name: Run mypy
run: |
mypy