force bc .gititnore is interfering #868
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
# This is a basic workflow to help you get started with Actions | |
name: covertest | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: [push] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 2 | |
matrix: | |
# python-version: [3.9.5, 3.10.0] | |
# python-version: [3.9.5] | |
python-version: [3.9] | |
# python-version: [3.10.0] | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@master | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest pytest-cov coverage coverage-badge | |
# python -m pip install --user scipy matplotlib pybind11 pytz pyyaml | |
cd cli/ | |
pip install -e . | |
cd .. | |
# ---------------------------------------- | |
# 2024-12-17 suppress geo/ for now - start | |
# cd geo/ | |
# pip install -e . | |
# cd ../ | |
# cd geo/src/bind/ | |
# pip install -e . | |
# cd ../../../ | |
# 2024-12-17 suppress geo/ for now - stop | |
# ---------------------------------------- | |
- name: Run tests with coverage | |
run: | | |
pytest cli --cov=cli > result.log; tail -n 10 result.log | |
- name: Generate coverage report | |
run: | | |
pytest cli --cov=xyfigure --cov-report=xml --cov-report=html | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: htmlcov/ | |
- name: Create coverage badge | |
run: | | |
coverage xml | |
coverage-badge -o coverage.svg | |
- name: Upload badge | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-badge | |
path: htmlcov/ | |
- name: Commit and push badge to gh-pages | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git checkout -B gh-pages # Create the branch if it does not exist | |
mkdir -p coverage_reports/htmlcov # Ensure the directory exists | |
cp coverage.svg coverage_reports/htmlcov/ # Copy the badge to the coverage report directory | |
cp -r htmlcov/* coverage_reports/htmlcov/ # Copy the HTML coverage report to the directory | |
git add -f coverage_reports/htmlcov/ coverage.svg | |
git commit -m "Update coverage badge" || echo "No changes to commit" | |
git push --force "https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages | |
#- name: Generate coverage report | |
# run: | | |
# # pip install pytest # already installed in pyproject.toml | |
# # pip install pytest-cov # already installed in pyproject.toml | |
# # pytest --cov=cli/src/xyfigure --cov=geo/src/ptg --cov-report=xml | |
# pytest cli --cov=cli/src/xyfigure --cov-report=xml | |
#- name: Upload coverage to Codecov | |
## uses: codecov/codecov-action@6004246f47ab62d32be025ce173b241cd84ac58e | |
# uses: codecov/[email protected] | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
# file: ./coverage.xml | |
# directory: ./coverage/reports/ | |
# flags: unittests | |
# env_vars: OS,PYTHON | |
# name: codecov-umbrella | |
# fail_ci_if_error: true | |