Merge pull request #158 from sclorg/add_codecov #168
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| name: Run Tox tests on betka | |
| jobs: | |
| coverage: | |
| name: Test coverage | |
| runs-on: ubuntu-latest | |
| env: | |
| DEPLOYMENT: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| pip install -e . | |
| pip install -r tests/requirements-test.txt | |
| - name: Run unit tests with coverage | |
| run: | | |
| python3 -m pytest tests/unit/ -v --cov=betka --cov-report=xml:coverage-unit.xml | |
| - name: Upload unit test coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: unit-tests | |
| files: coverage-unit.xml | |
| fail_ci_if_error: false | |
| - name: Run integration tests with coverage | |
| run: | | |
| python3 -m pytest tests/integration/ -v --cov=betka --cov-report=xml:coverage-integration.xml | |
| - name: Upload integration test coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: integration-tests | |
| files: coverage-integration.xml | |
| fail_ci_if_error: false | |
| tox_test: | |
| name: Tox test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| tox_env: [py311, py312, py313] | |
| # Use GitHub's Linux Docker host | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Run Tox tests on betka | |
| id: test | |
| uses: fedora-python/tox-github-action@main | |
| with: | |
| tox_env: ${{ matrix.tox_env }} | |
| dnf_install: gcc rpm-devel git python3-devel distgen nss_wrapper make python3-gitlab python3-pip python3-devel |