Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Documentation

on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, reopened, synchronize, closed]

permissions:
contents: write
pull-requests: write

concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-publish:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install uv and Python
uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Install project and docs dependencies
run: uv sync --group docs

- name: Build Great Docs site
run: uv run great-docs build

- name: Publish documentation
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: great-docs/_site
clean: true
clean-exclude: |
pr-preview/

preview:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install uv and Python
if: github.event.action != 'closed'
uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'

- name: Set up Quarto
if: github.event.action != 'closed'
uses: quarto-dev/quarto-actions/setup@v2

- name: Install project and docs dependencies
if: github.event.action != 'closed'
run: uv sync --group docs

- name: Build Great Docs preview
if: github.event.action != 'closed'
run: uv run great-docs build

- name: Deploy PR preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: great-docs/_site
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
62 changes: 20 additions & 42 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,43 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

# Build and test the Python package. Documentation is handled separately in docs.yml.
name: Python package

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

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
permissions:
id-token: write
contents: write
contents: read

steps:
- uses: actions/checkout@v4

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install the project
run: uv sync --all-extras --dev
- uses: actions/checkout@v4

- name: Build Package
run: uv build
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: Run tests
run: uv run pytest tests
- name: Install the project
run: uv sync --all-extras --dev

- name: Show package version
run: grep -r "version" pyproject.toml || grep -r "__version__" rtichoke/ || python -c "import rtichoke; print(rtichoke.__version__)"

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Set Git identity for Quarto publishing
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Build package
run: uv build

- name: Quartodoc build
working-directory: docs
run: uv run quartodoc build
- name: Run tests
run: uv run pytest tests

- name: Clean any leftover Quarto publish worktree
run: rm -rf .quarto

- name: Render and Publish
working-directory: docs
run: uv run quarto publish gh-pages --no-browser --no-prompt --token "${{ secrets.GITHUB_TOKEN }}"
- name: Show package version
run: grep -r "version" pyproject.toml || grep -r "__version__" rtichoke/ || python -c "import rtichoke; print(rtichoke.__version__)"

- name: Publish package
if: github.ref == 'refs/heads/main' && matrix.python-version == '3.10'
run: uv publish
- name: Publish package
if: github.ref == 'refs/heads/main' && matrix.python-version == '3.10'
run: uv publish
Loading
Loading