Downgrade: python3.10 -> python 3.9 #202
Workflow file for this run
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: Python Unit Tests | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| run_tests: | |
| runs-on: [ self-hosted ] | |
| container: python:3.10 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install package | |
| run: | | |
| ./dev-setup.sh | |
| - name: Install xmllint | |
| run: | | |
| apt-get update | |
| apt-get install -y libxml2-utils bc | |
| - name: Run unit tests with coverage | |
| id: extract_coverage | |
| run: | | |
| pytest test/unit -s --cov=nodescraper --cov-report=xml --cov-report=term --cov-fail-under=70 --maxfail=1 --disable-warnings -v | |
| - name: Print coverage | |
| run: | | |
| total_coverage=$(xmllint --xpath "string(//coverage/@line-rate)" coverage.xml) | |
| total_coverage_percentage=$(echo "$total_coverage * 100" | bc) | |
| echo "Total Coverage: $total_coverage_percentage%" | |
| echo "coverage_percentage=$total_coverage_percentage" >> $GITHUB_ENV | |
| - name: Display total coverage in Summary | |
| run: | | |
| echo "Total Coverage: ${{ env.coverage_percentage }}" >> $GITHUB_STEP_SUMMARY |