Merge pull request #3 from rbturnbull/tensor #38
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: docs | |
on: | |
push: | |
branches: main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@v1 | |
- name: Install dependencies for Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'poetry' | |
- run: poetry install | |
- name: Docs | |
run: | | |
poetry run sphinx-build -b html docs gh-pages | |
- name: Coverage | |
run: | | |
poetry run coverage run -m pytest | |
echo "COVERAGE=$(poetry run coverage report --precision 2 | grep TOTAL | tr -s ' ' | cut -f 4 -d " ")" >> $GITHUB_ENV | |
poetry run coverage html --directory gh-pages/coverage | |
- name: Deploy 🚀 | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: gh-pages # The folder the action should deploy. | |
- name: Create Coverage Badge | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: f99aea7ea203d16edd063a8dd5ed395f | |
filename: coverage-badge.json | |
label: coverage | |
message: ${{ env.COVERAGE }} | |
color: green | |