GA: Split out package-check job from coverage jobs #1
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
on: | |
push: | |
paths: | |
- 'python/**/*' | |
- .github/workflows/check-python.yml | |
pull_request: | |
paths: | |
- 'python/**/*' | |
- .github/workflows/check-python.yml | |
name: "Python checks" | |
permissions: | |
contents: read | |
jobs: | |
check: | |
if: "! contains(github.event.head_commit.message, '[ci skip]')" | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.10 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install port4me | |
run: | | |
cd python/ | |
pip install . | |
- name: Session information | |
run: | | |
python -c "import os; print('EUID='+str(os.geteuid()))" | |
python --version | |
python -m port4me --version | |
- name: Generate coverage report | |
run: | | |
pip install pytest-cov | |
cd python | |
pytest --cov=port4me ## output summarize in GitHub logs | |
pytest --cov=port4me --cov-report=xml:coverage.xml | |
## AD HOC: Make reported paths relative to the root of repository | |
sed -i 's/filename="/filename="python\/port4me\//g' coverage.xml | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
env_vars: OS,PYTHON | |
files: python/coverage.xml | |
fail_ci_if_error: true | |
flags: python | |
name: codecov-umbrella-python | |
verbose: true |