From 25e39d3544892810d2ce114481eba6c3bda505e7 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 2 Sep 2025 11:33:37 -0400 Subject: [PATCH] Adding docs build, project build, and tox CI workflows --- .riahub/workflows/build-docs.yaml | 17 ++++++++++ .riahub/workflows/build-project.yaml | 50 ++++++++++++++++++++++++++++ .riahub/workflows/tox.yaml | 32 ++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 .riahub/workflows/build-docs.yaml create mode 100644 .riahub/workflows/build-project.yaml create mode 100644 .riahub/workflows/tox.yaml diff --git a/.riahub/workflows/build-docs.yaml b/.riahub/workflows/build-docs.yaml new file mode 100644 index 0000000..be7fddc --- /dev/null +++ b/.riahub/workflows/build-docs.yaml @@ -0,0 +1,17 @@ +name: Build Docs + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ammaraskar/sphinx-action@0.4 + with: + docs-folder: "docs/" + pre-build-command: pip install -U sphinx sphinx-rtd-theme diff --git a/.riahub/workflows/build-project.yaml b/.riahub/workflows/build-project.yaml new file mode 100644 index 0000000..343775e --- /dev/null +++ b/.riahub/workflows/build-project.yaml @@ -0,0 +1,50 @@ +name: Build Project + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + project-build-check: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ '3.10', '3.11', '3.12' ] + + name: Build Project + steps: + - name: Check out project + uses: actions/checkout@v4 + + - name: Build project + run: | + poetry build + + - name: Set up Python environment + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Create Python virtual environment + run: | + python -m venv .venv + + - name: Install project in virtual environment + run: | + source .venv/bin/activate + pip install dist/*.whl + + # In the following step, 'pip list' prints out a list of installed dependencies. This is not required for the + # build but useful for debugging. + - name: Check dependency installation + run: | + source .venv/bin/activate + pip check + pip list + + - name: Very project import + run: | + source .venv/bin/activate + python -c "import ria_toolkit" diff --git a/.riahub/workflows/tox.yaml b/.riahub/workflows/tox.yaml new file mode 100644 index 0000000..769d57e --- /dev/null +++ b/.riahub/workflows/tox.yaml @@ -0,0 +1,32 @@ +name: Test with tox + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12'] + name: Test with tox + steps: + - name: Check out project + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install tox-gh-actions + run: | + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + + - name: Test with tox + run: | + tox