From 2b27f75399ee56625491ac7cb591eef244796609 Mon Sep 17 00:00:00 2001 From: LTLA Date: Tue, 23 Apr 2024 12:47:16 -0700 Subject: [PATCH] Added some actions for CI, page building. --- .github/workflows/build-docs.yaml | 39 +++++++++++++++++++++++++++++++ .github/workflows/run-tests.yaml | 37 +++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/build-docs.yaml create mode 100644 .github/workflows/run-tests.yaml diff --git a/.github/workflows/build-docs.yaml b/.github/workflows/build-docs.yaml new file mode 100644 index 0000000..87b2010 --- /dev/null +++ b/.github/workflows/build-docs.yaml @@ -0,0 +1,39 @@ +# 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: Build docs + +on: + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.9 + uses: actions/setup-python@v5 + with: + python-version: 3.9 + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest tox + + - name: Build docs + run: | + tox -e docs + + - name: GH Pages Deployment + uses: JamesIves/github-pages-deploy-action@4 + with: + branch: gh-pages # The branch the action should deploy to. + folder: ./docs/_build/html + clean: true # Automatically remove deleted files from the deploy branch diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml new file mode 100644 index 0000000..aee6f36 --- /dev/null +++ b/.github/workflows/run-tests.yaml @@ -0,0 +1,37 @@ +# 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: Test the library + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + + name: Python ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest tox + + - name: Test with tox + run: | + tox