Skip to content

Fix missing 'pirogue-admin redeploy' on first package installation. M… #32

Fix missing 'pirogue-admin redeploy' on first package installation. M…

Fix missing 'pirogue-admin redeploy' on first package installation. M… #32

Workflow file for this run

name: Build Python distribution
on:
push:
branches:
- main
- "v*.*.*"
- "test-me-*"
tags:
- "v*.*.*"
pull_request:
branches:
- main
- "v*.*.*"
types:
- opened # default
- synchronize # default
- reopened # default
- ready_for_review # used in PRs created from the release workflow
env:
PYTEST_ADDOPTS: "--color=yes"
# Cancel running jobs for the same workflow and branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
env:
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.16"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install tox
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
- name: Install Python
if: startsWith(matrix.env, '3.') && matrix.env != '3.13'
run: uv python install --python-preference only-managed ${{ matrix.env }}
- name: Setup environment ${{ matrix.env }}
run: tox run --notest --skip-missing-interpreters false -e ${{ matrix.env }}
- name: Run environment ${{ matrix.env }}
run: tox run --skip-pkg-install -e ${{ matrix.env }}
- name: Generate reports
shell: bash
run: |
if [ -f "test-report.md" ]; then
echo "### Test Report" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "test-report.md" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
rm -f test-report.md
fi
if [ -f "test-coverage.md" ]; then
echo "### Code coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
cat "test-coverage.md" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
rm -f test-coverage.md
fi
doc:
needs:
- build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.16"
python-version: "3.13"
- name: Install the project
run: uv sync --all-extras --dev
- name: Install tox
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv
- name: Generate documentation
shell: bash
run: |
tox run -e docs
- name: Upload documentation
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/_build/html
- name: Publish documentation on GitHub Pages
uses: actions/deploy-pages@v4
id: deployment
release:
name: Publish Python 🐍 distribution 📦 to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs:
- doc
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pirogue-mongoose
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.7.16"
python-version: "3.13"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install the project
run: uv sync --all-extras --dev
- name: Build
run: uv build
- name: Publish
run: uv publish