Code Coverage #14
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
| name: Code Coverage | |
| on: | |
| workflow_dispatch: # Allows manual trigger via GitHub web UI | |
| jobs: | |
| code-coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install coverage llvmlite | |
| - name: Create coverage config | |
| run: | | |
| printf '[run]\nomit = trekbasicpy/trek_bot.py\n\n[report]\nfail_under = 50\n' > .coveragerc | |
| cat .coveragerc | |
| - name: Clone BasicTestSuite | |
| run: git clone https://github.com/cocode/BasicTestSuite | |
| - name: Run tests with coverage | |
| run: | | |
| ls -l | |
| ls -l .. | |
| ./run_coverage_tests.py BasicTestSuite || true | |
| coverage xml | |
| coverage report || true | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: true |