Skip to content

make-a-release

make-a-release #26

Workflow file for this run

name: CI
# Trigger the workflow on push and pull request events to the main branch
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
# Job 1: Run Tests
test:
name: Run Tests on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
# Define a matrix of Python versions to test against
strategy:
matrix:
python-version: [3.11, 3.12, 3.13]
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Set up the specified Python version
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Step 3: Install dependencies using Hatch
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
hatch env create
hatch run install
# Step 4: Run the test suite
- name: Run Tests
run: hatch run test
# Job 2: Build and Deploy Documentation
build_and_deploy_docs:
name: Build and Deploy Documentation
runs-on: ubuntu-latest
needs: test # Ensure tests pass before building docs
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v4
# Step 2: Set up Python (using a specific version for consistency)
- name: Set Up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
# Step 3: Install dependencies for building docs
- name: Install Documentation Dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
hatch env create docs
hatch run docs-build
# Step 4: Deploy the generated docs to the gh-pages branch
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/site
publish_branch: gh-pages