i24 2.3.3

A Rust library for working with 24-bit integers.
Documentation
name: Build and Deploy Documentation

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: "pages"
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: '3.11'

    - name: Set up Rust
      uses: dtolnay/rust-toolchain@stable

    - name: Create virtual environment
      run: |
        python -m venv .venv

    - name: Install documentation dependencies
      run: |
        source .venv/bin/activate
        python -m pip install --upgrade pip
        pip install sphinx sphinx-autodoc-typehints sphinx-rtd-theme myst-parser sphinx-copybutton
        pip install numpy>=1.26
        pip install maturin

    - name: Build and install i24 package
      run: |
        source .venv/bin/activate
        maturin develop --release

    - name: Build documentation
      run: |
        source .venv/bin/activate
        cd docs
        make html

    - name: Setup Pages
      uses: actions/configure-pages@v4

    - name: Upload artifact
      uses: actions/upload-pages-artifact@v3
      with:
        path: 'docs/build/html'

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    if: github.ref == 'refs/heads/main'

    steps:
    - name: Deploy to GitHub Pages
      id: deployment
      uses: actions/deploy-pages@v4