Update lint_test_build_pipeline.yml #140
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: Codacy Coverage Reporter | |
# Source: | |
# https://github.com/codacy/codacy-coverage-reporter-action | |
# https://docs.codacy.com/coverage-reporter/ | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches-ignore: | |
- kyu2 | |
- kyu3 | |
- kyu4 | |
- kyu5 | |
- kyu6 | |
- kyu7 | |
- kyu8 | |
- utils | |
- Documentation | |
workflow_call: | |
secrets: | |
codacy_api_token: | |
required: true | |
jobs: | |
codacy-coverage-reporter: | |
runs-on: 'ubuntu-24.04' | |
# Adding 'timeout-minutes: 10' would prevent jobs from running | |
# indefinitely if something goes wrong | |
timeout-minutes: 10 | |
name: codacy-coverage-reporter | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@main | |
with: | |
python-version: "3.12" | |
check-latest: true | |
- name: Check Python version | |
run: python --version | |
- name: Install prerequisites | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade setuptools | |
python -m pip install --upgrade wheel | |
python -m pip install --no-cache-dir -r requirements.txt --upgrade | |
- name: Install pytest, pytest-cov | |
run: | | |
python -m pip install pytest | |
python -m pip install pytest-cov | |
- name: Check pytest, pytest-cov version | |
run: | | |
python -m pytest --version | |
- name: Generate coverage report | |
# yamllint disable rule:line-length | |
run: | | |
python -m pytest . -v --cov-report term-missing --cov-report=xml --cov=./ --junitxml=junit.xml -o junit_family=legacy --debug | |
# yamllint enable rule:line-length | |
- name: List test files | |
run: | | |
ls *.xml | |
# https://docs.codacy.com/coverage-reporter/ | |
- name: Run codacy-coverage-reporter | |
run: | | |
export CODACY_API_TOKEN=${{ secrets.codacy_api_token }} | |
export CODACY_ORGANIZATION_PROVIDER=gh | |
export CODACY_USERNAME=iKostanOrg | |
export CODACY_PROJECT_NAME=codewars | |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml |