diff --git a/.ci/merge-fixes.sh b/.ci/merge-fixes.sh index 1fb8267df0e..8ee138660ec 100755 --- a/.ci/merge-fixes.sh +++ b/.ci/merge-fixes.sh @@ -14,10 +14,10 @@ else git tag -f test_base git commit -q -m "Uncommitted changes" --no-allow-empty -a for a in $PRs; do + git fetch --unshallow --all > /dev/null 2>&1 && echo "Unshallowed." echo "::group::Merging PR https://github.com/$REPO/pull/$a" git tag -f test_head $GH pr checkout -b pr-$a $a - git fetch --unshallow --all git checkout -q test_head if git merge --no-edit --squash -q pr-$a; then echo "::endgroup::" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ac9c6154d0..5f466d3a285 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -193,11 +193,12 @@ jobs: run: | ./venv/bin/python3 -m coverage combine src/.coverage/ ./venv/bin/python3 -m coverage xml - find . -name *coverage* + mkdir -p coverage-report + mv coverage.xml coverage-report/ working-directory: ./worktree-image - name: Upload coverage to codecov if: always() && steps.build.outcome == 'success' uses: codecov/codecov-action@v3 with: - files: ./worktree-image/coverage.xml + directory: ./worktree-image/coverage-report diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 22df4aa0fd5..7fd2064a108 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -34,39 +34,20 @@ permissions: jobs: - # standard-pre for the default platform (used by build.yml etc.) - default-pre: + # standard-pre and standard (without ptest) for the default platform (used by build.yml etc.) + default: uses: ./.github/workflows/docker.yml with: # Build from scratch - docker_targets: "with-system-packages configured with-targets-pre" + docker_targets: "with-system-packages configured with-targets-pre with-targets" # FIXME: duplicated from env.TARGETS targets_pre: all-sage-local - tox_system_factors: >- - ["ubuntu-focal"] - tox_packages_factors: >- - ["standard"] - docker_push_repository: ghcr.io/${{ github.repository }}/ - - # standard for the default platform (used by build.yml etc.) - default: - if: ${{ success() || failure() }} - needs: [default-pre] - uses: ./.github/workflows/docker.yml - with: - # Build incrementally from previous stage (pre) - incremental: true - free_disk_space: true - from_docker_repository: ghcr.io/${{ github.repository }}/ - from_docker_target: "with-targets-pre" - docker_targets: "with-targets with-targets-optional" - # FIXME: duplicated from env.TARGETS targets: build doc-html targets_optional: ptest tox_system_factors: >- ["ubuntu-focal"] tox_packages_factors: >- - ["standard"] + ["standard"] docker_push_repository: ghcr.io/${{ github.repository }}/ # All platforms. This duplicates the default platform, but why not, @@ -83,6 +64,9 @@ jobs: tox_packages_factors: >- ["standard"] docker_push_repository: ghcr.io/${{ github.repository }}/ + # Make sure that all "standard-pre" jobs can start simultaneously, + # so that runners are available by the time that "default" starts. + max_parallel: 50 standard: if: ${{ success() || failure() }} @@ -101,6 +85,8 @@ jobs: tox_packages_factors: >- ["standard"] docker_push_repository: ghcr.io/${{ github.repository }}/ + # Reduce from 30 to 25 because it runs in parallel with 'standard-sitepackages' below + max_parallel: 25 standard-sitepackages: if: ${{ success() || failure() }} @@ -153,8 +139,6 @@ jobs: minimal-pre: if: ${{ success() || failure() }} - # It does not really "need" it. - needs: [standard] uses: ./.github/workflows/docker.yml with: # Build from scratch @@ -164,6 +148,9 @@ jobs: tox_packages_factors: >- ["minimal"] docker_push_repository: ghcr.io/${{ github.repository }}/ + # Reduced from 30 because it may run in parallel with 'standard-sitepackages' above. + # Calibrated for clogging the job pipeline until the "default" job has finished. + max_parallel: 20 minimal: if: ${{ success() || failure() }} diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index fb2229ba7b4..5bf5729039c 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -99,7 +99,7 @@ jobs: with: user: __token__ password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }} - skip_existing: true + skip-existing: true verbose: true if: env.CAN_DEPLOY == 'true' @@ -180,7 +180,7 @@ jobs: with: user: __token__ password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }} - packages_dir: wheelhouse/ - skip_existing: true + packages-dir: wheelhouse/ + skip-existing: true verbose: true if: env.CAN_DEPLOY == 'true' diff --git a/.github/workflows/doc-build-pdf.yml b/.github/workflows/doc-build-pdf.yml index 2128277fbca..1d14d0c29f7 100644 --- a/.github/workflows/doc-build-pdf.yml +++ b/.github/workflows/doc-build-pdf.yml @@ -66,8 +66,6 @@ jobs: git config --global user.email "ci-sage@example.com" git config --global user.name "Build & Test workflow" .ci/retrofit-worktree.sh worktree-image /sage - # Keep track of changes to built HTML - new_version=$(cat src/VERSION.txt); (cd /sage/local/share/doc/sage/html/en && find . -name "*.html" | xargs sed -i '/class="sidebar-brand-text"/s/Sage [0-9a-z.]* /Sage '$new_version' /'; git init && (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; git add -A && git commit --quiet -m "old") - name: Download upstream artifact uses: actions/download-artifact@v3 @@ -107,19 +105,20 @@ jobs: id: docbuild if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success') run: | - make doc-clean doc-uninstall; make doc-pdf + 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: always() && 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/en/* ./docs + cp -r -L /sage/local/share/doc/sage/pdf ./docs # Zip everything for increased performance zip -r docs-pdf.zip docs diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 5eb3998feee..e079fa04beb 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -63,12 +63,12 @@ jobs: mathjax_path_to=$(SAGE_USE_CDNS=yes /sage/sage -python -c "from sage_docbuild.conf import mathjax_path; print(mathjax_path)") new_version=$(cat src/VERSION.txt) # Wipe out chronic diffs between old doc and new doc - (cd /sage/local/share/doc/sage/html/en && \ + (cd /sage/local/share/doc/sage/html && \ find . -name "*.html" | xargs sed -i -e '/class="sidebar-brand-text"/ s/Sage [0-9a-z.]* /Sage '"$new_version"' /' \ -e 's;'"$mathjax_path_from"';'"$mathjax_path_to"';' \ -e '\;; d') # Create git repo from old doc - (cd /sage/local/share/doc/sage/html/en && \ + (cd /sage/local/share/doc/sage/html && \ git init && \ (echo "*.svg binary"; echo "*.pdf binary") >> .gitattributes && \ (echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \ @@ -116,9 +116,9 @@ jobs: run: | set -ex export SAGE_USE_CDNS=yes - mv /sage/local/share/doc/sage/html/en/.git /sage/.git-doc + mv /sage/local/share/doc/sage/html/.git /sage/.git-doc make doc-clean doc-uninstall - mkdir -p /sage/local/share/doc/sage/html/en/ && mv /sage/.git-doc /sage/local/share/doc/sage/html/en/.git + mkdir -p /sage/local/share/doc/sage/html/ && mv /sage/.git-doc /sage/local/share/doc/sage/html/.git ./config.status && make sagemath_doc_html-no-deps working-directory: ./worktree-image env: @@ -131,9 +131,9 @@ jobs: run: | set -ex mkdir -p ./docs - (cd /sage/local/share/doc/sage/html/en && git commit -a -m 'new') + (cd /sage/local/share/doc/sage/html && git commit -a -m 'new') # Wipe out chronic diffs between old doc and new doc - (cd /sage/local/share/doc/sage/html/en && \ + (cd /sage/local/share/doc/sage/html && \ find . -name "*.html" | xargs sed -i -e '\;; d') # Create CHANGES.html echo '' > ./docs/CHANGES.html @@ -162,7 +162,7 @@ jobs: EOF echo '' >> ./docs/CHANGES.html echo '
' >> ./docs/CHANGES.html - (cd /sage/local/share/doc/sage/html/en && git diff HEAD^; rm -rf .git) > ./docs/diff.txt + (cd /sage/local/share/doc/sage/html && git diff HEAD^ -- *.html; rm -rf .git) > ./docs/diff.txt /sage/sage -python - << EOF import re, html with open('./docs/diff.txt', 'r') as f: @@ -172,7 +172,7 @@ jobs: for block in diff_blocks: match = re.search(r'^diff --git a/(.*) b/\1', block, flags=re.MULTILINE) if match: - path = match.group(1) + path = 'html/' + match.group(1) out_blocks.append(f'\n' + html.escape(block).strip() + '
')
output_text = '\n'.join(out_blocks)
with open('./docs/diff.html', 'w') as f:
@@ -182,11 +182,12 @@ jobs:
echo '' >> ./docs/CHANGES.html
echo '