Skip to content

Commit

Permalink
Build, upload documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanElsner committed Nov 16, 2023
1 parent d49950d commit 0493a51
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Check commit
on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: write
Expand Down Expand Up @@ -31,7 +30,7 @@ jobs:
- name: Test with pytest
run: |
pytest ./tests/
upload:
coverage:
name: Upload coverage report
needs: unittest
runs-on: ubuntu-latest
Expand Down Expand Up @@ -73,12 +72,54 @@ jobs:
pylint --rcfile .pylintrc --output-format=text --exit-zero src/ | tee ./pylint/pylint.log
PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
anybadge --label=Pylint --file=pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green
- name: Upload linting artifact
uses: actions/upload-artifact@v3
with:
name: linting
path: ./pylint
documentation:
name: Build documentation
runs-on: ubuntu-latest
needs: unittest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[doc]
- name: Build with Sphinx
run: cd doc && make html
- name: Upload documentation artifact
uses: actions/upload-artifact@v2
with:
name: documentation
path: ./doc/_build/html
upload:
name: Upload to GitHub pages
runs-on: ubuntu-latest
needs: [documentation, linting]
steps:
- name: Download documentation artifact
uses: actions/download-artifact@v2
with:
name: documentation
path: ./html
- name: Download linting artifact
uses: actions/download-artifact@v2
with:
name: linting
path: ./html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./pylint
path: ./html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 0493a51

Please sign in to comment.