From 57260136c4f655c85ba6027fe5a966da4a6821b7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 22:17:00 -0700 Subject: [PATCH] .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: |