Fix UCIS WG link #145
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: CI | |
| on: | |
| - push | |
| - pull_request | |
| - workflow_dispatch | |
| jobs: | |
| ci-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| # - uses: actions/setup-python@v2 | |
| # with: | |
| # python-version: '3.9' | |
| - name: Configure Python | |
| run: | | |
| python3 -m pip install ivpm | |
| python3 -m ivpm update -a | |
| ./packages/python/bin/python3 -m pip install wheel twine | |
| ./packages/python/bin/python3 -m pip install pip setuptools --upgrade | |
| rm -rf dist build *.egg-info src/*.egg-info | |
| sed -i -e "s/version = \"\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)\"/version = \"\1.${GITHUB_RUN_ID}\"/" pyproject.toml | |
| grep "^version = " pyproject.toml | |
| export BUILD_NUM=$GITHUB_RUN_ID | |
| echo "BUILD_NUM=${BUILD_NUM}" | |
| ./packages/python/bin/python3 setup.py bdist_wheel --universal | |
| - name: Run Tests | |
| run: | | |
| ./packages/python/bin/python3 -m pip install pytest pytest-cov | |
| ./packages/python/bin/python3 -m pip install -e . | |
| ./packages/python/bin/python3 -m pytest tests/unit --cov=ucis --cov-report=term-missing --cov-report=html --cov-report=json | |
| - name: Upload Coverage to Summary | |
| if: always() | |
| run: | | |
| # Generate coverage percentage | |
| COVERAGE=$(./packages/python/bin/python3 -c "import json; data=json.load(open('coverage.json')); print(f\"{data['totals']['percent_covered']:.1f}\")") | |
| # Add to GitHub Step Summary | |
| echo "## Test Coverage Report" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "**Overall Coverage: ${COVERAGE}%**" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| # Add coverage details | |
| ./packages/python/bin/python3 << 'EOF' >> $GITHUB_STEP_SUMMARY | |
| import json | |
| data = json.load(open('coverage.json')) | |
| print("| File | Statements | Missing | Coverage |") | |
| print("|------|------------|---------|----------|") | |
| for file, info in sorted(data['files'].items()): | |
| if 'ucis' in file: # Only show project files | |
| fname = file.split('src/')[-1] if 'src/' in file else file | |
| stmts = info['summary']['num_statements'] | |
| missing = info['summary']['missing_lines'] | |
| covered = info['summary']['covered_lines'] | |
| pct = info['summary']['percent_covered'] | |
| print(f"| {fname} | {stmts} | {missing} | {pct:.1f}% |") | |
| EOF | |
| - name: Upload Coverage HTML | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: htmlcov/ | |
| - name: Build Docs | |
| run: | | |
| ./packages/python/bin/python3 -m pip install -r doc/requirements.txt | |
| make html | |
| touch doc/build/html/.nojekyll | |
| cp -r doc/build/html . | |
| - name: Publish Docs | |
| if: startsWith(github.ref, 'refs/heads/master') | |
| uses: JamesIves/github-pages-deploy-action@4.1.7 | |
| with: | |
| branch: gh-pages | |
| folder: html | |
| - name: Publish to PyPi | |
| if: startsWith(github.ref, 'refs/heads/master') | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |