67 fix code scanning alert high severity improper control of generation of code code injection vulnerability in setupt #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: Codecov Coverage Report | |
on: | |
pull_request_target: | |
types: | |
- opened | |
- edited | |
- synchronize | |
- reopened | |
# Why is Codecov upload step in GitHub Actions not finding the token? | |
# https://stackoverflow.com/questions/78298827/why-is-codecov-upload-step-in-github-actions-not-finding-the-token | |
workflow_call: | |
secrets: | |
codecov_token: | |
required: true | |
jobs: | |
run: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [ "3.12" ] | |
steps: | |
- uses: actions/checkout@main | |
- name: Setup Python | |
uses: actions/setup-python@main | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install prerequisites | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install -r requirements.txt | |
- name: Install pytest, pytest-cov | |
run: | | |
pip install pytest | |
pip install pytest-cov | |
- name: Generate coverage report | |
run: | | |
python -c "import os; print(os.getcwd())" | |
python -m pytest tests/ -v --cov-report term-missing --cov=lessons --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.codecov_token }} | |
files: coverage.xml | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
attempt_limit: 5 | |
attempt_delay: 30000 |