fix #587
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
- 'dev/**' | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
jobs: | |
unit-test: | |
strategy: | |
matrix: | |
python-version: [3.9, '3.10', '3.11'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
python-version: 3.8 | |
- os: macos-latest | |
python-version: 3.8 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
# check package is importable | |
python -c "import ploomber_engine" | |
python -c "import ploomber_engine.client" | |
python -c "import ploomber_engine.ipython" | |
pip install ".[dev]" | |
pip install "matplotlib<3.7" | |
- name: Lint | |
run: | | |
pip install pkgmt | |
pkgmt lint | |
- name: Unit tests | |
run: | | |
pytest --ignore=tests/test_engine.py --durations-min=5 | |
- name: Unit tests (papermill) | |
run: | | |
pip install papermill ipykernel | |
python -c "import ploomber_engine.engine" | |
pytest tests/test_engine.py --durations-min=5 | |
- name: Doc tests | |
run: | | |
pytest src/ --doctest-modules | |
readme-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.9] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install jupyblog | |
run: | | |
pip install --upgrade pip | |
pip install nbclient jupytext pkgmt ipykernel | |
pip install . | |
- name: Test readme | |
run: | | |
pkgmt test-md --file README.md | |
# run: pkgmt check | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install 'pkgmt[check]' | |
- name: Check project | |
run: | | |
pkgmt check | |
release: | |
needs: [unit-test, readme-test, check] | |
if: startsWith(github.ref, 'refs/tags') && github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install pkgmt twine wheel --upgrade | |
- name: Upload | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
TAG: ${{ github.ref_name }} | |
run: | | |
echo "tag is $TAG" | |
pkgmt release $TAG --production --yes |