From 8963884532441607e41e33cef68b4b7a962eccc7 Mon Sep 17 00:00:00 2001 From: erexer <13180883+erexer@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:06:02 -0800 Subject: [PATCH] rename github actions, add auto-build docs github action --- .github/workflows/docs.yml | 40 +++++++++++++++++++++++ .github/workflows/{build.yml => test.yml} | 6 ++-- 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/docs.yml rename .github/workflows/{build.yml => test.yml} (89%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..e2e0509 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,40 @@ +name: docs + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install pandoc + run: | + sudo apt-get update -y && sudo apt-get install -y pandoc + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Update pip and install python dependencies + run: | + python -m pip install --upgrade pip + pip install .[docs] + - name: Build html docs + working-directory: 'docs/' + run: | + make html + - name: Commit documentation changes + run: | + cd docs/build/html + git init + git add -A + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -m 'deploy' -a || true + - name: Push changes to gh-pages + uses: ad-m/github-push-action@master + with: + branch: gh-pages + directory: docs/build/html + force: true + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/test.yml similarity index 89% rename from .github/workflows/build.yml rename to .github/workflows/test.yml index fa0759d..3fe1959 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: build +name: test on: [push, pull_request] @@ -31,7 +31,5 @@ jobs: - name: Test and generate coverage report on Linux run: | - pip install pytest - pip install pytest-cov + pip install .[test] pytest --cov=./ --cov-report=xml -