Skip to content

Commit

Permalink
only build docs once
Browse files Browse the repository at this point in the history
  • Loading branch information
BenJourdan committed Oct 12, 2024
1 parent 8662cf1 commit 39d7bcd
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11] # Test on multiple Python versions
python-version: ['3.8', '3.9', '3.10', '3.11'] # Python versions as strings

steps:
# Step 1: Checkout the code
Expand Down Expand Up @@ -52,16 +52,16 @@ jobs:
pip install -r requirements.txt
shell: bash

# Step 6: Run Ruff linter and fix issues
- name: Run Ruff (Python linter and fix)
# Step 6: Run Ruff linter and fail on any issues
- name: Run Ruff (Python linter)
run: |
ruff check . --fix
ruff check .
shell: bash

# Step 7: Run Black formatter
- name: Run Black (Python formatter)
run: |
black .
black --check .
shell: bash

# Step 8: Build and install the Rust library using Maturin (in release mode)
Expand All @@ -76,14 +76,36 @@ jobs:
pytest tests/
shell: bash

# Step 10: Build Sphinx documentation
# Separate job for deploying the documentation
deploy:
runs-on: ubuntu-latest
needs: linux # Ensure this job only runs after the matrix job completes
steps:
# Step 1: Checkout the code
- name: Checkout the code
uses: actions/checkout@v4

# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # Just need a single Python version to build docs

# Step 3: Install dependencies for docs
- name: Install dependencies for docs
run: |
pip install --upgrade pip
pip install -r requirements.txt
shell: bash

# Step 4: Build Sphinx documentation
- name: Build Sphinx documentation
run: |
cd docs
make html
shell: bash

# Step 11: Deploy documentation to GitHub Pages
# Step 5: Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down

0 comments on commit 39d7bcd

Please sign in to comment.