Skip to content

feat: support LiteralString #342

feat: support LiteralString

feat: support LiteralString #342

Workflow file for this run

name: Documentation
on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- master
paths:
- apischema/**
- benchmark/**
- docs/**
- examples/**
- mkdocs.yml
- pyproject.toml
pull_request:
paths:
- apischema/**
- benchmark/**
- docs/**
- examples/**
- mkdocs.yml
jobs:
run_benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install apischema
run: pip install -e .
- name: Install requirements
run: pip install -r benchmark/requirements.txt
- name: Run benchmark
run: python benchmark/main.py
- uses: actions/upload-artifact@v3
with:
name: benchmark_table
path: examples/benchmark_table.md
- uses: actions/upload-artifact@v3
with:
name: benchmark_chart_light
path: docs/benchmark_chart_light.svg
- uses: actions/upload-artifact@v3
with:
name: benchmark_chart_dark
path: docs/benchmark_chart_dark.svg
upload_doc:
needs: [run_benchmark]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- uses: actions/download-artifact@v3
with:
name: benchmark_table
path: examples
- uses: actions/download-artifact@v3
with:
name: benchmark_chart_light
path: docs
- uses: actions/download-artifact@v3
with:
name: benchmark_chart_dark
path: docs
- name: Install requirements
run: pip install -r docs/requirements.txt
- name: Build documentation
run: mkdocs build
- uses: actions/upload-artifact@v3
with:
name: documentation
path: site/**
publish_doc:
needs: [run_benchmark]
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'release'
steps:
- uses: actions/[email protected]
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('tests/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# TODO bump to 3.12 when mike will support it
python-version: '3.11'
- uses: actions/download-artifact@v3
with:
name: benchmark_table
path: examples
- uses: actions/download-artifact@v3
with:
name: benchmark_chart_light
path: docs
- uses: actions/download-artifact@v3
with:
name: benchmark_chart_dark
path: docs
- name: Install requirements
run: pip install -r docs/requirements.txt
- name: Setup git
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch origin gh-pages --depth=1
- name: Set environment variable
run: |
echo "version=$(cat pyproject.toml | grep "version =" | cut -d' ' -f3 | cut -d'"' -f2 | cut -d. -f-2)" >> $GITHUB_ENV
echo "revision=$(cat pyproject.toml | grep "version =" | cut -d' ' -f3 | cut -d'"' -f2 | cut -d. -f3)" >> $GITHUB_ENV
echo "latest=$(mike list latest -j | jq .version -r)" >> $GITHUB_ENV
- name: Publish dev documentation
if: github.event_name == 'push' && env.version != env.latest
run: mike deploy -p $version dev -t "dev" -u
- name: Publish latest documentation
if: github.event_name == 'release' && env.revision == '0'
run: |
mike retitle latest "$latest"
mike deploy -p $version latest -t "$version (latest)" -u
- name: Publish patch documentation
if: github.event_name == 'release' && env.revision != '0'
run: mike deploy -p $version