Fix version #101
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
POETRY_VERSION: 1.3.2 | |
jobs: | |
build: | |
name: poetry-build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
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 poetry | |
uses: Gr1N/setup-poetry@v8 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}-${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
poetry install -E dev | |
- name: Test with pytest | |
run: | | |
poetry run coverage run -m pytest -l -rPap -vvv -p no:warnings | |
poetry run coverage xml | |
- name: codecov | |
run: | | |
bash <(curl -s https://codecov.io/bash) | |
- name: type check | |
run: | | |
poetry run mypy ridgeplot | |
publish: | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install poetry | |
uses: Gr1N/setup-poetry@v8 | |
with: | |
poetry-version: ${{ env.POETRY_VERSION }} | |
- name: publish to pypi | |
run: | | |
poetry self add poetry-dynamic-versioning | |
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }} | |
- name: push tag | |
run: | | |
gh release create $(poetry version --short) | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
name: deploy doc | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
needs: [publish, build] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: setup | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
- name: build and deploy doc | |
run: | | |
pip install mkdocs-material mkdocstrings-python mkdocs | |
mkdocs gh-deploy --force |