Restructure sage.*.all
for modularization, replace relative by absolute imports
#6242
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build documentation (PDF) | |
on: | |
pull_request: | |
push: | |
workflow_dispatch: | |
# Allow to run manually | |
inputs: | |
platform: | |
description: 'Platform' | |
required: true | |
default: 'ubuntu-focal-standard' | |
docker_tag: | |
description: 'Docker tag' | |
required: true | |
default: 'dev' | |
concurrency: | |
# Cancel previous runs of this workflow for the same branch | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
get_ci_fixes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: Merge CI fixes from sagemath/sage | |
run: | | |
mkdir -p upstream | |
.ci/merge-fixes.sh 2>&1 | tee upstream/ci_fixes.log | |
env: | |
GH_TOKEN: ${{ github.token }} | |
SAGE_CI_FIXES_FROM_REPOSITORIES: ${{ vars.SAGE_CI_FIXES_FROM_REPOSITORIES }} | |
- name: Store CI fixes in upstream artifact | |
run: | | |
if git format-patch --stdout test_base > ci_fixes.patch; then | |
cp ci_fixes.patch upstream/ | |
fi | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: upstream | |
name: upstream | |
build-docs-pdf: | |
runs-on: ubuntu-latest | |
container: ghcr.io/sagemath/sage/sage-${{ github.event.inputs.platform || 'ubuntu-focal-standard' }}-with-targets:${{ github.event.inputs.docker_tag || 'dev'}} | |
needs: [get_ci_fixes] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update system packages | |
run: | | |
export PATH="build/bin:$PATH" | |
eval $(sage-print-system-package-command auto update) | |
eval $(sage-print-system-package-command auto --yes --no-install-recommends install zip) | |
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git texlive texlive_luatex free_fonts xindy) | |
- name: Add prebuilt tree as a worktree | |
id: worktree | |
run: | | |
git config --global --add safe.directory $(pwd) | |
git config --global user.email "[email protected]" | |
git config --global user.name "Build & Test workflow" | |
.ci/retrofit-worktree.sh worktree-image /sage | |
- name: Download upstream artifact | |
uses: actions/download-artifact@v3 | |
with: | |
path: upstream | |
name: upstream | |
- name: Apply CI fixes from sagemath/sage | |
# After applying the fixes, make sure all changes are marked as uncommitted changes. | |
run: | | |
if [ -r upstream/ci_fixes.patch ]; then | |
(cd worktree-image && git commit -q -m "current changes" --allow-empty -a && git am; git reset --quiet old; git add -N .) < upstream/ci_fixes.patch | |
fi | |
- name: Incremental build | |
id: incremental | |
run: | | |
# Now re-bootstrap and build. The build is incremental because we were careful with the timestamps. | |
./bootstrap && make build | |
working-directory: ./worktree-image | |
env: | |
MAKE: make -j2 --output-sync=recurse | |
SAGE_NUM_THREADS: 2 | |
- name: Build (fallback to non-incremental) | |
id: build | |
if: (success() || failure()) && steps.worktree.outcome == 'success' && steps.incremental.outcome != 'success' | |
run: | | |
set -ex | |
make sagelib-clean && git clean -fx src/sage && ./config.status && make build | |
working-directory: ./worktree-image | |
env: | |
MAKE: make -j2 --output-sync=recurse | |
SAGE_NUM_THREADS: 2 | |
- name: Build docs (PDF) | |
id: docbuild | |
if: (success() || failure()) && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success') | |
run: | | |
make doc-clean doc-uninstall; make sagemath_doc_html-build-deps sagemath_doc_pdf-no-deps | |
working-directory: ./worktree-image | |
env: | |
MAKE: make -j2 --output-sync=recurse | |
SAGE_NUM_THREADS: 2 | |
- name: Copy docs | |
id: copy | |
if: (success() || failure()) && steps.docbuild.outcome == 'success' | |
run: | | |
# For some reason the deploy step below cannot find /sage/... | |
# So copy everything from there to local folder | |
mkdir -p ./docs | |
cp -r -L /sage/local/share/doc/sage/pdf ./docs | |
# Zip everything for increased performance | |
zip -r docs-pdf.zip docs | |
- name: Upload docs | |
if: (success() || failure()) && steps.copy.outcome == 'success' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: docs-pdf | |
path: docs-pdf.zip |