From 421b552c5da6805e7867228ad2f1ca973ad6866d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 2 Jun 2024 22:50:23 -0700 Subject: [PATCH 01/12] .github/workflows/ci-linux-incremental.yml (sitepackages): Remove label condition --- .github/workflows/ci-linux-incremental.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index 88a31a5ce42..5613a4b71a3 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -107,14 +107,6 @@ jobs: site: needs: [changed_files] - if: | - github.event_name != 'pull_request' || - ((github.event.action != 'labeled' && - (contains(github.event.pull_request.labels.*.name, 'c: packages: standard') || - contains(github.event.pull_request.labels.*.name, 'c: packages: optional'))) || - (github.event.action == 'labeled' && - (github.event.label.name == 'c: packages: optional' || - github.event.label.name == 'c: packages: standard'))) uses: ./.github/workflows/docker.yml with: # Build incrementally from published Docker image From e90d73704bef9cf52d1678e4f6affea96baacda3 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 2 Jun 2024 23:22:24 -0700 Subject: [PATCH 02/12] .github/workflows/build.yml: Determine build_targets (adapted from ci-linux-incremental.yml) --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 161704a280c..9d355e29482 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,6 +78,8 @@ env: jobs: test-new: runs-on: ubuntu-latest + outputs: + build_targets: ${{ steps.build-targets.outputs.build_targets }} services: # https://docs.docker.com/build/ci/github-actions/local-registry/ registry: @@ -98,6 +100,42 @@ jobs: - name: Checkout id: checkout uses: actions/checkout@v4 + - name: Get all packages that have changed + id: changed-packages + uses: tj-actions/changed-files@v44 + with: + files_yaml: | + configures: + - 'build/pkgs/*/spkg-configure.m4' + pkgs: + - 'build/pkgs/**' + - 'pkgs/**' + - name: Determine targets to build + id: build-targets + run: | + uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) + build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) + if [ -n "$uninstall_targets" ]; then + echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT + else + echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT + fi + cat $GITHUB_OUTPUT + - uses: actions/checkout@v4 + with: + ref: ${{ github.base_ref }} + path: worktree-base + if: github.base_ref && steps.changed-packages.outputs.pkgs_all_changed_files + - name: Compute metrics + run: | + export PATH=build/bin:$PATH + if [ -d worktree-base ]; then + (echo "# $GITHUB_BASE_REF"; SAGE_ROOT=worktree-base sage-package metrics :all:) > base-metrics.txt + (echo "# $GITHUB_REF"; sage-package metrics :all:) > metrics.txt + diff --color=always --width=100 --side-by-side --left-column base-metrics.txt metrics.txt || true + else + sage-package metrics :all: + fi - name: Install test prerequisites # From docker.yml run: | @@ -153,7 +191,7 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ steps.build-targets.outputs.build_targets }} - name: Start container run: | @@ -266,7 +304,7 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container run: | @@ -361,7 +399,7 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container id: container @@ -473,7 +511,7 @@ jobs: NUMPROC=6 USE_MAKEFLAGS=-k V=0 SAGE_NUM_THREADS=4 --output-sync=recurse TARGETS_PRE=build/make/Makefile - TARGETS=ci-build-with-fallback + TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container id: container From dae0ff152b11481dab1358ce7ef4bd2075c07284 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 2 Jun 2024 23:54:06 -0700 Subject: [PATCH 03/12] .github/workflows/build.yml: Combine calls of tj-actions/changed-files --- .github/workflows/build.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d355e29482..45a8bb56e8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,21 +100,25 @@ jobs: - name: Checkout id: checkout uses: actions/checkout@v4 - - name: Get all packages that have changed - id: changed-packages + - name: Get changed files and packages + id: changed-files uses: tj-actions/changed-files@v44 with: + # File extensions for doctests per sage.doctest.control.skipfile files_yaml: | configures: - 'build/pkgs/*/spkg-configure.m4' pkgs: - 'build/pkgs/**' - 'pkgs/**' + doctests: + - 'src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex}' + - '!src/{setup,conftest*}.py' - name: Determine targets to build id: build-targets run: | - uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) - build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) + uninstall_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) + build_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) if [ -n "$uninstall_targets" ]; then echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT else @@ -125,7 +129,7 @@ jobs: with: ref: ${{ github.base_ref }} path: worktree-base - if: github.base_ref && steps.changed-packages.outputs.pkgs_all_changed_files + if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files - name: Compute metrics run: | export PATH=build/bin:$PATH @@ -213,20 +217,12 @@ jobs: ./sage -python -m pytest -c tox.ini -qq --doctest --collect-only || true shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v44 - with: - # File extensions per sage.doctest.control.skipfile - files: src/**/*.{py,pyx,pxd,pxi,sage,spyx,rst,tex} - files_ignore: src/{setup,conftest*}.py - - name: Test changed files (sage -t --new) - if: steps.changed-files.outputs.all_changed_files + if: steps.changed-files.outputs.doctests_all_changed_files run: | export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4 # https://github.com/tj-actions/changed-files?tab=readme-ov-file#outputs- - ./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.all_changed_files }} + ./sage -t --long --format github -p4 ${{ steps.changed-files.outputs.doctests_all_changed_files }} shell: sh .ci/docker-exec-script.sh BUILD /sage {0} test-mod: From 62ade48069563b91335ee7361c14f7427ed55343 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 00:55:52 -0700 Subject: [PATCH 04/12] .github/workflows/build.yml (test-new): Do not push and do not start container if nothing to be tested --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45a8bb56e8d..605707ffd9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -184,7 +184,7 @@ jobs: # more reliable than "load", for which we observed random failure # conditions in which the built image could not be found. # - push: true + push: ${{ steps.changed-files.outputs.doctests_all_changed_files && true || false }} load: false context: . tags: ${{ env.BUILD_IMAGE }} @@ -198,6 +198,7 @@ jobs: TARGETS=${{ steps.build-targets.outputs.build_targets }} - name: Start container + if: steps.changed-files.outputs.doctests_all_changed_files run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -207,6 +208,7 @@ jobs: # Testing - name: Check that all modules can be imported + if: steps.changed-files.outputs.doctests_all_changed_files run: | # Increase the length of the lines in the "short summary" export COLUMNS=120 From 9d3a3f23c052ef89fd175085acd8003c587eb67b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 11:42:51 -0700 Subject: [PATCH 05/12] .github/workflows/ci-linux-incremental.yml: Remove duplicate testing of the default platform (ubuntu-jammy) --- .github/workflows/ci-linux-incremental.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index 5613a4b71a3..e63c097bec3 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -91,7 +91,6 @@ jobs: targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" tox_system_factors: >- ["ubuntu-focal", - "ubuntu-jammy", "ubuntu-mantic", "debian-bullseye", "debian-bookworm", From 4db331384bb68a7b1e9899ac6bd6c148cc1642aa Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 11:46:40 -0700 Subject: [PATCH 06/12] .github/workflows/ci-linux-incremental.yml: Replace ubuntu-mantic, fedora-38 by latest --- .github/workflows/ci-linux-incremental.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index e63c097bec3..a74eb4e0597 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -91,11 +91,11 @@ jobs: targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" tox_system_factors: >- ["ubuntu-focal", - "ubuntu-mantic", + "ubuntu-noble", "debian-bullseye", "debian-bookworm", "fedora-30", - "fedora-38", + "fedora-40", "gentoo-python3.11", "debian-bullseye-i386"] tox_packages_factors: >- From 358609098cb3d951b829fd25af0d80980a11de69 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 12:07:15 -0700 Subject: [PATCH 07/12] .github/workflows/ci-linux-incremental.yml: Update build_target script from build.yml, use ptest-nodoc to avoid duplicate doc-html build --- .github/workflows/ci-linux-incremental.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-linux-incremental.yml b/.github/workflows/ci-linux-incremental.yml index a74eb4e0597..ce468ff3a42 100644 --- a/.github/workflows/ci-linux-incremental.yml +++ b/.github/workflows/ci-linux-incremental.yml @@ -41,12 +41,11 @@ jobs: runs-on: ubuntu-latest name: List changed packages outputs: - uninstall_targets: ${{ steps.build-targets.outputs.uninstall_targets }} build_targets: ${{ steps.build-targets.outputs.build_targets }} steps: - uses: actions/checkout@v4 - name: Get all packages that have changed - id: changed-packages + id: changed-files uses: tj-actions/changed-files@v44 with: files_yaml: | @@ -58,14 +57,19 @@ jobs: - name: Determine targets to build id: build-targets run: | - echo "uninstall_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u))" >> $GITHUB_OUTPUT - echo "build_targets=$(echo $(for a in '' ${{ steps.changed-packages.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u))" >> $GITHUB_OUTPUT + uninstall_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.configures_all_changed_files }}; do echo $a | sed -E 's,build/pkgs/([a-z0-9][_.a-z0-9]*)/spkg-configure[.]m4 *,\1-uninstall,'; done | sort -u)) + build_targets=$(echo $(for a in '' ${{ steps.changed-files.outputs.pkgs_all_changed_files }}; do SPKG=$(echo $a | sed -E 's,-,_,g;s,(build/)?pkgs/([a-z0-9][-_.a-z0-9]*)/[^ ]* *,\2,;'); if [ -f "build/pkgs/$SPKG/checksums.ini" -o -f "build/pkgs/$SPKG/requirements.txt" -o -f "build/pkgs/$SPKG/spkg-install" ]; then echo "$SPKG-ensure"; fi; done | sort -u)) + if [ -n "$uninstall_targets" ]; then + echo "build_targets=$uninstall_targets reconfigure $build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT + else + echo "build_targets=$build_targets ci-build-with-fallback" >> $GITHUB_OUTPUT + fi cat $GITHUB_OUTPUT - uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} path: worktree-base - if: github.base_ref + if: github.base_ref && steps.changed-files.outputs.pkgs_all_changed_files - name: Compute metrics run: | export PATH=build/bin:$PATH @@ -88,7 +92,7 @@ jobs: from_docker_target: "with-targets" from_docker_tag: "dev" docker_targets: "with-targets" - targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" + targets: "${{needs.changed_files.outputs.build_targets}} doc-html ptest-nodoc" tox_system_factors: >- ["ubuntu-focal", "ubuntu-noble", @@ -115,7 +119,7 @@ jobs: from_docker_target: "with-targets" from_docker_tag: "dev" docker_targets: "with-targets" - targets: "${{needs.changed_files.outputs.uninstall_targets}} reconfigure ${{needs.changed_files.outputs.build_targets}} build doc-html ptest" + targets: "${{needs.changed_files.outputs.build_targets}} doc-html ptest-nodoc" # Only test systems with a usable system python (>= 3.9) # with only a small number of test failures as of 10.2.rc0 tox_system_factors: >- From 1df4f5a5c508dfdbb8779161283cf780459dd908 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 3 Jun 2024 18:27:13 -0700 Subject: [PATCH 08/12] .ci/retrofit-worktree.sh: Commit /new --- .ci/retrofit-worktree.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/retrofit-worktree.sh b/.ci/retrofit-worktree.sh index eba1b674ecb..4c283f7ff4a 100755 --- a/.ci/retrofit-worktree.sh +++ b/.ci/retrofit-worktree.sh @@ -23,9 +23,10 @@ set -x # If actions/checkout downloaded our source tree using the GitHub REST API # instead of with git (because do not have git installed in our image), # we first make the source tree a repo. -if [ ! -d .git ]; then git init && git add -A && git commit --quiet -m "new"; fi +if [ ! -d .git ]; then git init; fi -# Tag this state of the source tree "new". This is what we want to build and test. +# Commit and tag this state of the source tree "new". This is what we want to build and test. +git add -A && git commit --quiet --allow-empty -m "new" git tag -f new # Our container image contains a source tree in $WORKTREE_DIRECTORY with a full build of Sage. From 8d0c849d0d1f4d6a4b45d857722f0dfe8f43240e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 15:07:45 -0700 Subject: [PATCH 09/12] .ci/write-dockerfile.sh: Remove old /new at the beginning, remove new /new at the end --- .ci/write-dockerfile.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index 67ef594729c..ffdfa5404f6 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -264,6 +264,7 @@ cat < Date: Tue, 4 Jun 2024 15:09:09 -0700 Subject: [PATCH 10/12] .ci/write-dockerfile.sh: Remove duplicated ADD --- .ci/write-dockerfile.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index ffdfa5404f6..beee1440368 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -339,7 +339,6 @@ ENV SAGE_CHECK=warn ENV SAGE_CHECK_PACKAGES="!cython,!r,!python3,!gap,!cysignals,!linbox,!git,!ppl,!cmake,!rpy2,!sage_sws2rst" $ADD .gitignore /new/.gitignore $ADD src /new/src -ADD .ci /.ci RUN cd /new && rm -rf .git && \ if /.ci/retrofit-worktree.sh worktree-pre /sage; then \ cd /sage && touch configure build/make/Makefile; \ From 7fb032388d799a2e06d9a41dd60a7a6dde32bf6a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 16:46:13 -0700 Subject: [PATCH 11/12] .ci/write-dockerfile.sh: Remove old .git file at the beginning, remove new .git file at the end --- .ci/write-dockerfile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/write-dockerfile.sh b/.ci/write-dockerfile.sh index beee1440368..3a4ae5b152d 100755 --- a/.ci/write-dockerfile.sh +++ b/.ci/write-dockerfile.sh @@ -264,7 +264,7 @@ cat < Date: Tue, 4 Jun 2024 22:17:00 -0700 Subject: [PATCH 12/12] .github/workflows/*build*.yml: Survive GHA cache upload timeouts --- .github/workflows/build.yml | 17 ++++++++++++++--- .github/workflows/doc-build-pdf.yml | 6 ++++++ .github/workflows/doc-build.yml | 5 +++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 605707ffd9e..c7200f847d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -198,7 +198,9 @@ jobs: TARGETS=${{ steps.build-targets.outputs.build_targets }} - name: Start container - if: steps.changed-files.outputs.doctests_all_changed_files + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) && steps.changed-files.outputs.doctests_all_changed_files run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -208,7 +210,7 @@ jobs: # Testing - name: Check that all modules can be imported - if: steps.changed-files.outputs.doctests_all_changed_files + if: (success() || failure()) && steps.container.outcome == 'success' && steps.changed-files.outputs.doctests_all_changed_files run: | # Increase the length of the lines in the "short summary" export COLUMNS=120 @@ -220,7 +222,7 @@ jobs: shell: sh .ci/docker-exec-script.sh BUILD /sage {0} - name: Test changed files (sage -t --new) - if: steps.changed-files.outputs.doctests_all_changed_files + if: (success() || failure()) && steps.container.outcome == 'success' && steps.changed-files.outputs.doctests_all_changed_files run: | export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4 # https://github.com/tj-actions/changed-files?tab=readme-ov-file#outputs- @@ -305,6 +307,8 @@ jobs: TARGETS=${{ needs.test-new.outputs.build_targets }} - name: Start container + id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -314,6 +318,7 @@ jobs: # Testing - name: Test modularized distributions + if: (success() || failure()) && steps.container.outcome == 'success' run: | export MAKE="make -j2 --output-sync=recurse" SAGE_NUM_THREADS=4 make V=0 tox-ensure && make ${{ matrix.targets }} @@ -401,6 +406,7 @@ jobs: - name: Start container id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -410,6 +416,7 @@ jobs: # Testing - name: Test all files (sage -t --long ${{ matrix.tests }}) + if: (success() || failure()) && steps.container.outcome == 'success' run: | mkdir .coverage rm -rf /sage/.coverage @@ -513,6 +520,7 @@ jobs: - name: Start container id: container + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -526,8 +534,10 @@ jobs: with: path: .coverage pattern: coverage-* + if: (success() || failure()) && steps.container.outcome == 'success' - name: Coverage report + if: (success() || failure()) && steps.container.outcome == 'success' # Using --omit to avoid "CoverageWarning: Couldn't parse '/tmp/tmp06qizzie/tmp_ldpu46ob.py': No source for code" run: | rm -rf /sage/.coverage @@ -541,6 +551,7 @@ jobs: shell: sh .ci/docker-exec-script.sh BUILD . {0} - name: Upload coverage to codecov + if: (success() || failure()) && steps.container.outcome == 'success' uses: codecov/codecov-action@v4 with: directory: .coverage/coverage-report diff --git a/.github/workflows/doc-build-pdf.yml b/.github/workflows/doc-build-pdf.yml index d4cc6ebc6ca..2eac8e17ffc 100644 --- a/.github/workflows/doc-build-pdf.yml +++ b/.github/workflows/doc-build-pdf.yml @@ -101,6 +101,9 @@ jobs: TARGETS=ci-build-with-fallback - name: Start container + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -110,6 +113,8 @@ jobs: # Docs - name: Update system packages + id: packages + if: (success() || failure()) && steps.container.outcome == 'success' run: | export PATH="build/bin:$PATH" eval $(sage-print-system-package-command auto update) @@ -119,6 +124,7 @@ jobs: - name: Build docs (PDF) id: docbuild + if: (success() || failure()) && steps.packages.outcome == 'success' run: | export MAKE="make -j5 --output-sync=recurse" SAGE_NUM_THREADS=5 make doc-clean doc-uninstall; make sagemath_doc_html-build-deps sagemath_doc_pdf-no-deps diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 4d0420874b8..f47dac38d57 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -105,6 +105,9 @@ jobs: TARGETS=ci-build-with-fallback - name: Start container + id: container + # Try to continue when "exporting to GitHub Actions Cache" failed with timeout + if: (success() || failure()) run: | docker run --name BUILD -dit \ --mount type=bind,src=$(pwd),dst=$(pwd) \ @@ -115,6 +118,7 @@ jobs: - name: Store old docs id: worktree + if: (success() || failure()) && steps.container.outcome == 'success' run: | git config --global --add safe.directory $(pwd) git config --global user.email "ci-sage@example.com" @@ -140,6 +144,7 @@ jobs: - name: Build docs id: docbuild + if: (success() || failure()) && steps.worktree.outcome == 'success' # Always non-incremental because of the concern that # incremental docbuild may introduce broken links (inter-file references) though build succeeds run: |