Merge pull request #29 from e10e3/sklearn-example #115
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
name: Build | |
on: push | |
jobs: | |
build-n-publish: | |
name: Build and publish (${{ matrix.python }} on ${{ matrix.os }}) | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-latest] | |
python: ['3.8.x', '3.9.x', '3.10.x', '3.11.x'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install . | |
python -m pip install codecov pytest-cov | |
- name: Run pytest | |
run: | | |
pytest tests/ --cov=autorank/ --cov-report=xml | |
- name: Install setuptools | |
run: | | |
python -m pip install setuptools wheel | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python setup.py sdist bdist_wheel | |
- name: Build documentation | |
run: | | |
python -m pip install pydoc-markdown==2.1.3 | |
mkdir docs | |
mkdir docs/examples | |
cp examples/* docs/examples/ | |
cp flowchart.png docs/ | |
pydocmd build | |
- name: Publish to codecov | |
if: matrix.os=='ubuntu-22.04' && matrix.python=='3.7.x' | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Publish documentation of master on gh-pages | |
if: matrix.os=='ubuntu-22.04' && matrix.python=='3.7.x' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: _build/site | |
- name: Publish distribution to PyPI | |
if: startsWith(github.event.ref, 'refs/tags') && matrix.os=='ubuntu-22.04' && matrix.python=='3.7.x' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.pypi_password }} |