test: test coverage summary #7
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: Code Coverage | |
on: | |
push: | |
branches: [ pre-prod ] | |
pull_request: | |
branches: [ pre-prod ] | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
bench init frappe-bench --frappe-path https://github.com/8848digital/frappe-v15.git --frappe-branch pre-prod | |
bench init --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench | |
cd ~/frappe-bench | |
bench get-app https://github.com/${{ github.repository }} | |
bench setup requirements --dev | |
- name: Install coverage dependencies | |
run: | | |
cd ~/frappe-bench/apps/${{ github.event.repository.name }} | |
pip install coverage pytest pytest-cov | |
- name: Run tests with coverage | |
run: | | |
cd ~/frappe-bench/apps/${{ github.event.repository.name }} | |
coverage run -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
verbose: true |