adding format #146
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] | |
jobs: | |
build: | |
name: rye CI | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11'] | |
defaults: | |
run: | |
shell: bash -l {0} | |
permissions: | |
# Gives the action the necessary permissions for publishing new | |
# comments in pull requests. | |
pull-requests: write | |
# Gives the action the necessary permissions for pushing data to the | |
# python-coverage-comment-action branch, and for editing existing | |
# comments (to avoid publishing multiple comments in the same PR) | |
contents: write | |
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 the latest version of rye | |
uses: eifinger/setup-rye@v3 | |
- name: Install dependencies | |
run: | | |
rye sync --no-lock | |
- name: check | |
run: | | |
rye run check | |
- uses: py-cov-action/python-coverage-comment-action@v3 | |
id: coverage_comment | |
if: matrix.python-version == '3.9' && github.ref != 'refs/heads/main' | |
with: | |
GITHUB_TOKEN: ${{ github.token }} | |
ANNOTATE_MISSING_LINES: true | |
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 the latest version of rye | |
uses: eifinger/setup-rye@v4 | |
- name: Build dist | |
run: | | |
rye build --verbose | |
- name: publish to pypi | |
run: | | |
rye publish --token ${{ secrets.PYPI_TOKEN }} --yes --verbose | |
- name: push tag | |
run: | | |
gh release create $(rye version) | |
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 |