diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e0c695..ae501fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,6 @@ name: Check commit on: push: branches: ["main"] - workflow_dispatch: permissions: contents: write @@ -31,7 +30,7 @@ jobs: - name: Test with pytest run: | pytest ./tests/ - upload: + coverage: name: Upload coverage report needs: unittest runs-on: ubuntu-latest @@ -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 + \ No newline at end of file