2.69.18 #2111
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |