Skip to content

Commit

Permalink
.github/workflows/*build*.yml: Survive GHA cache upload timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 5, 2024
1 parent 7fb0323 commit 5726013
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand All @@ -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
Expand All @@ -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-
Expand Down Expand Up @@ -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) \
Expand All @@ -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 }}
Expand Down Expand Up @@ -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) \
Expand All @@ -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
Expand Down Expand Up @@ -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) \
Expand All @@ -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
Expand All @@ -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
6 changes: 6 additions & 0 deletions .github/workflows/doc-build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand All @@ -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)
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand All @@ -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"
Expand All @@ -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: |
Expand Down

0 comments on commit 5726013

Please sign in to comment.