CI #192
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, pull_request] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, '3.10', '3.11'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
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: Lint | |
run: | | |
python -m pip install --upgrade pip pkgmt | |
pkgmt lint | |
- name: Install dependencies | |
run: | | |
pip install . | |
# check package is importable | |
python -c "import ploomber_core" | |
pip install ".[dev]" | |
- name: Doctests | |
run: | | |
pytest src --doctest-modules | |
- name: Unit tests | |
run: | | |
pytest --durations-min=5 | |
# 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: [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 |