Skip to content

use newer codecov version #526

use newer codecov version

use newer codecov version #526

Workflow file for this run

name: Test and build docs
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
test:
name: Run Unittest
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install Python ${{ matrix.python }}
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python }}
- name: Install SciKit-GStat
run: |
pip3 install -r requirements.txt
python3 setup.py install
- name: Install PyTest requirements
run: pip3 install -r "requirements.unittest.${{ matrix.python }}.txt"
- name: Run tests
run: pytest --cov-config=.coveragerc --cov=./ --cov-report=xml
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
env_vars: OS, PYTHON
docs:
name: Build and deploy documentation
runs-on: ubuntu-20.04
needs: test
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install Python
uses: actions/setup-python@master
with:
python-version: '3.8'
- name: Install SciKit-GStat
run: |
pip3 install -r requirements.txt
python3 setup.py install
- name: Install Sphinx requirements
run: pip3 install -r requirements.rtd.txt
# - name: Upgrade
# run: sudo apt update && sudo apt -y upgrade
- name: Install pdflatex
run: sudo apt install texlive-latex-extra texlive-latex-recommended texlive-fonts-recommended pandoc
- name: make HTML & LaTeX docs
run: |
cd docs
make html
make latex
continue-on-error: true
- name: compile LaTeX
run: |
cd docs/_build/latex
pdflatex -interaction=nonstopmode -halt-on-error SciKitGStat.tex
cd ../..
cp _build/latex/SciKitGStat.pdf _build/html
continue-on-error: true
- name: deploy to gh pages
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: gh-pages
build_dir: docs/_build/html
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create Github release
runs-on: ubuntu-20.04
needs: test
if: startsWith(github.event.ref, 'refs/tags/v') && endsWith(github.event.ref, '.0')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE.md
generate_release_notes: true
publish:
name: Publish to PyPi
runs-on: ubuntu-20.04
needs: test
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
ci_develop:
name: Print Github Context for Development
runs-on: ubuntu-20.04
if: true
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"