chore: fix code coverage report #1458
Workflow file for this run
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.9] | |
env: | |
PGPORT: "5433" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup docker | |
run: | | |
docker-compose --version | |
sudo apt-get update | |
sudo apt-get -y install ca-certificates curl gnupg | |
sudo install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
sudo chmod a+r /etc/apt/keyrings/docker.gpg | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update | |
sudo apt-get install -y docker-compose-plugin | |
docker-compose --version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip codecov flake8 | |
- name: Run flake8 | |
run: | | |
flake8 vmaas/ | |
- 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 ./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 -m vmaas.common.wait_for_services python3 -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: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage_common.xml,./coverage_reposcan.xml,./coverage_webapp.xml | |
verbose: true |