Refactoring quantecon-book-theme #529
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: continuous-integration | |
on: | |
push: | |
branches: [master] | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- uses: pre-commit/[email protected] | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} and Sphinx ${{ matrix.sphinx }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -e .[test] | |
- name: Run pytest | |
run: > | |
pytest --durations=10 --cov=quantecon_book_theme --cov-report=xml --cov-report=term-missing | |
- name: Upload to Codecov | |
if: github.repository == 'QuantEcon/quantecon-book-theme' | |
uses: codecov/[email protected] | |
with: | |
name: ebp-sbt-pytests-py3.7 | |
flags: pytests | |
file: ./coverage.xml | |
fail_ci_if_error: true | |
publish: | |
name: Publish to PyPi | |
needs: [pre-commit, tests] | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Build package | |
run: | | |
pip install wheel | |
python setup.py sdist bdist_wheel | |
- name: Publish | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_KEY }} |