Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Build & Test: First build incrementally and test changed files only #35652

Merged
merged 28 commits into from
Jun 21, 2023

Conversation

mkoeppe
Copy link
Member

@mkoeppe mkoeppe commented May 19, 2023

📚 Description

This gives a faster turnaround for errors in the committed changes.
When the incremental build (or the test) fails, we clean thoroughly and build sagelib from scratch (= what happened before this PR.)

Changing the docbuild CI in the same way.

The full doctests are now run with --long.

Also:

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe requested a review from tobiasdiez May 19, 2023 02:54
@mkoeppe mkoeppe self-assigned this May 19, 2023
@mkoeppe mkoeppe requested a review from dimpase May 24, 2023 20:51
git config --global user.email "ci-sage@example.com"
git config --global user.name "Build & Test workflow"
# If actions/checkout downloaded using the GitHub REST API:
if [ ! -d .git ]; then git config --global --add safe.directory $(pwd) && git init && git add -A && git commit --quiet -m "new"; fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this git acrobatics, why not get the list of changed files using say https://github.com/marketplace/actions/get-all-changed-files and then run the tests on each of them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not just for finding the changed files.
This trick makes the build of the Sage library actually incremental!

eval $(sage-print-system-package-command auto update)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git)

- name: Incremental build and test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this coming before the actual build/is this not building things twice now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, in fact, also run the main build on the incrementally updated source tree.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this "incremental" build, what is build if one changes a python file, a cython file and say something in the build infrastructure (say a package update and a change in setup.py)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git acrobatics has exactly the same effect as doing a "git checkout" to the new ref in a full build of the Sage distribution on a developer's computer: The timestamps (mtime) of unmodified files are kept the same, and the timestamps of modified files are newer than any file that was there before.
It is looking so complicated because the source tree in our Docker images is actually not a git working copy. This is why I have to turn it surgically into a working copy (without messing up the timestamps).

Running make build results in an incremental build: For spkgs, if the declared package version is changed, then (because they no longer match the installation records in {local,venv}/var/libs/sage/installed these packages are reinstalled.
For the Sage library, the normal in-tree editable build is run, which is incremental (only the modified Cython files are cythonized and the result compiled). Because we are using editable mode, nothing interesting is happening with the modified Python files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the details!

But doesn't this mean that sometimes the incremental build (+ test) fails? At least locally, I sometimes have to hard-reset everything and run the whole bootstrap + configure + make cycle. In this cases, the workflow would fail, right? I'm not sure if this then more confusing than helpful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, incremental builds are very robust, with the following exceptions:

  • the docbuild process
  • after indiscriminate updates of system packages (we don't do that here on this workflow)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "hard reset", do you mean that you do "make distclean" (= remove local and venv)?

Sometimes, but most often I only have to run bootstrap & configure again.

Copy link
Contributor

@tobiasdiez tobiasdiez May 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, incremental builds are very robust, with the following exceptions:

Okay, then I let someone else with more experience on the build process have a look at this PR. Since this is the most important build workflow, it should only fail for the correct reason and not because of some general issues related to the build process.

If the incremental build is not (yet) reliable enough, I would favor a normal build + test on changed files + long test; and/or extracting the incremental build to a new workflow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "hard reset", do you mean that you do "make distclean" (= remove local and venv)?

Sometimes, but most often I only have to run bootstrap & configure again.

Ah OK. We can certainly run bootstrap manually before doing the incremental build. I'll make this change.
(configure definitely does not have to be run manually.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the incremental build is not (yet) reliable enough, I would favor a normal build + test on changed files + long test; and/or extracting the incremental build to a new workflow.

@tobiasdiez @kwankyu I have now implemented a fallback to non-incremental when the incremental build fails – both for build and for docbuild.

@kwankyu
Copy link
Collaborator

kwankyu commented May 27, 2023

This works well in the step "Incremental build and test", but in the step "Configure new tree" fails with

Run # Reuse built SAGE_LOCAL contained in the Docker image
/__w/_temp/[5](https://github.com/kwankyu/sage/actions/runs/5099185206/jobs/9166745669?pr=23#step:6:6)1d2b[6](https://github.com/kwankyu/sage/actions/runs/5099185206/jobs/9166745669?pr=23#step:6:7)8c-7390-4ae9-a05b-0268b824e3c8.sh: 2: ./configure: not found
Error: Process completed with exit code 127.

and then in the step "Build and test modularized distributions" fails with

...
rc/doc/bootstrap:87: installing src/doc/en/reference/spkg/*.rst
configure.ac:57: installing 'config/compile'
configure.ac:57: installing 'config/config.guess'
configure.ac:57: installing 'config/config.sub'
configure.ac:43: installing 'config/install-sh'
configure.ac:43: installing 'config/missing'
rm -f config.log
mkdir -p logs/pkgs
ln -s logs/pkgs/config.log config.log
****************************************************************************
make[1]: Leaving directory '/__w/sage/sage'
error: Sage source tree is unconfigured. Please run "./configure" first.
note:  Type "./configure --help" to see the available configuration options.
****************************************************************************
make[1]: *** [Makefile:[56](https://github.com/kwankyu/sage/actions/runs/5099185206/jobs/9166745669?pr=23#step:7:57): build/make/Makefile] Error 1
make: *** [Makefile:39: tox] Error 2
Error: Process completed with exit code 2.

@kwankyu
Copy link
Collaborator

kwankyu commented May 28, 2023

Thanks.

I am testing it again. So far so good.

Tobias' concern remains. I think incremental build (except doc building) is reliable, but we would not know if it (the concern) is real before we actually deploy incremental build for testing. It is worth to try!

@kwankyu
Copy link
Collaborator

kwankyu commented May 28, 2023

In my own testing of this PR and also here, we have failure

sage -t --long --random-seed=318874684740931170515189074049952937868 sage/doctest/test.py
**********************************************************************
File "sage/doctest/test.py", line 260, in sage.doctest.test
Failed example:
    os.kill(pid, signal.SIGQUIT) # long time; 10 seconds passed => dead
Expected:
    Traceback (most recent call last):
    ...
    ProcessLookupError: ...
Got:
    <BLANKLINE>
**********************************************************************

@kwankyu
Copy link
Collaborator

kwankyu commented May 28, 2023

"Build & Test" ran the build workflow of this PR. How is this possible?

@mkoeppe
Copy link
Member Author

mkoeppe commented May 28, 2023

Strange indeed. I'll restart the workflow to see if this is deterministic

kwankyu added a commit to kwankyu/sage that referenced this pull request May 28, 2023
@kwankyu
Copy link
Collaborator

kwankyu commented May 29, 2023

This seems just normal. GitHub Actions runs workflow on pull_request event in the forked repo, and hence it is safe to run workflows changed in PR?

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 13, 2023

Thank you!

@github-actions
Copy link

Documentation preview for this PR (built with commit 908ad71) is ready! 🎉

@vbraun vbraun merged commit ad35d8c into sagemath:develop Jun 21, 2023
@mkoeppe mkoeppe added this to the sage-10.1 milestone Jun 21, 2023
@kwankyu
Copy link
Collaborator

kwankyu commented Jun 22, 2023

Isn't this so designed that if there are doctest failures in the initial incremental build, it is reported and the B&T stops?

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 22, 2023

is it not working as expected?

@mkoeppe mkoeppe deleted the ci_more_incremental branch June 22, 2023 21:15
@kwankyu
Copy link
Collaborator

kwankyu commented Jun 22, 2023

See this #35809

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 22, 2023

It is not working as I expected. But perhaps it's working as it was designed?

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 22, 2023

In https://github.com/sagemath/sage/actions/runs/5349883585/jobs/9701778982?pr=35809 it is reported by a red X in the step. Are you saying that the final result is a green checkmark but it should be a red X?

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 22, 2023

Yes. I expect that the B&T itself stops with red X right after the red X in the step.

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 22, 2023

so that people can recognize the failure asap.

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 22, 2023

It is okay if it was so designed that the full test always runs. It is an improvement. But It seems a little inconvenient that people need to click the B&T to recognize the doctest failures in the incremental build while the full B&T will take much longer because of --long to get the final result. This is against the whole point of the PR...

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 22, 2023

I did design it so, but you have a very good point.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 22, 2023

I'll be happy to change this, but I first have to take care of this strange bug:

vbraun pushed a commit that referenced this pull request Jul 1, 2023
…html

    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes #12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

This new feature from #35652 was supposed to show the changed HTML
files,
but a last minute change there destroyed it.

Here we fix it.

<!-- Describe your changes here in detail. -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #35808
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
vbraun pushed a commit that referenced this pull request Jul 9, 2023
    
<!-- Please provide a concise, informative and self-explanatory title.
-->
<!-- Don't put issue numbers in the title. Put it in the Description
below. -->
<!-- For example, instead of "Fixes #12345", use "Add a new method to
multiply two integers" -->

### 📚 Description

<!-- Describe your changes here in detail. -->
The CI change in #35652 did not handle the case of a PR that adds files
correctly: the fallback to the non-incremental build would delete these
files.
We fix it here.
<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
Fixes
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x
]`. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #35865
Reported by: Matthias Köppe
Reviewer(s): Dima Pasechnik
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 19, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

Reworking sagemath#35652 as discussed in
sagemath#36469 (comment)

Also applying the changes made in sagemath#35866 (cosmetic improvements to the
Actions logs of doc-build.yml) to doc-build-pdf.yml

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36473
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 2, 2023

It is okay if it was so designed that the full test always runs. It is an improvement. But It seems a little inconvenient that people need to click the B&T to recognize the doctest failures in the incremental build while the full B&T will take much longer because of --long to get the final result. This is against the whole point of the PR...

I'm taking care of this in #36498

vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 18, 2024
…arate jobs for pyright, build, modularized tests, long tests

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
Running the containers explicitly, instead of using the declarative
`container:` feature of GH Actions gives us more control:
- we can create more space on the host if necessary; we just scraped by
an out of space condition in sagemath#36473 /
sagemath#36469 (comment)
- we can run some operations outside of the container but in the same
job; this will make the separate "Get CI fixes" jobs unnecessary,
addressing the cosmetic concerns from
sagemath#36338 (comment),
sagemath#36349
- it enables caching between the various workflows (as first discussed
in sagemath#36446).

We split out static type checking with pyright into its separate
workflow:
- **pyright.yml**: As static checking does not need  a build of the Sage
library, for PRs that do not make any changes to packages, there's
nothing to build, and the workflow gives a fast turnaround just after 10
minutes. For applying the CI fixes from blocker tickets, this workflow
uses the technique favored in sagemath#36349.

The workflow **build.yml** first launches a job:
- **test-new:** It builds incrementally (using a tox-generated
`Dockerfile` and https://github.com/marketplace/actions/build-and-push-
docker-images) and does the quick incremental test. This completes
within 10 to 20 minutes when there's no change.

After this is completed, more jobs are launched:
- **test-mod:** It again builds incrementally and tests a modularized
distribution. Later (with more from sagemath#35095), more jobs will be added to
this matrix job for other distributions.
- **test-long:** It again builds incrementally and runs the long test.

The workflows **doc-build.yml** and **doc-build-pdf.yml** again build
incrementally and then build the documentation. The diffing code for the
HTML documentation now runs in the host, not the container, which
simplifies things. (To show that diffing still works, we include a small
change to the Sage library.)

Splitting the workflow jobs implements @kwankyu's  suggestion from:
- sagemath#35652 (comment)
(Fixes sagemath#35814)

The steps "again builds incrementally" actually use the GH Actions
cache, https://docs.docker.com/build/ci/github-actions/cache/#cache-
backend-api. When nothing is cached and the 3 workflows are launched in
parallel, they may each build the same thing. But when there's
congestion that leads to the workflows to be run serially, the 2nd and
3rd workflow will be able to use the cache from the 1st workflow. This
elasticity may be helpful in reducing congestion.

There is a rather small per-project limit of 10 GB for this cache, so
we'll have to see how effectively caching works in practice. See
https://github.com/sagemath/sage/actions/caches


<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#36938 (merged here)
- Depends on sagemath#36951 (merged here)
- Depends on sagemath#37351 (merged here)
- Depends on sagemath#37750 (merged here)

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36498
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Apr 20, 2024
…arate jobs for pyright, build, modularized tests, long tests

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
Running the containers explicitly, instead of using the declarative
`container:` feature of GH Actions gives us more control:
- we can create more space on the host if necessary; we just scraped by
an out of space condition in sagemath#36473 /
sagemath#36469 (comment)
- we can run some operations outside of the container but in the same
job; this will make the separate "Get CI fixes" jobs unnecessary,
addressing the cosmetic concerns from
sagemath#36338 (comment),
sagemath#36349
- it enables caching between the various workflows (as first discussed
in sagemath#36446).

We split out static type checking with pyright into its separate
workflow:
- **pyright.yml**: As static checking does not need  a build of the Sage
library, for PRs that do not make any changes to packages, there's
nothing to build, and the workflow gives a fast turnaround just after 10
minutes. For applying the CI fixes from blocker tickets, this workflow
uses the technique favored in sagemath#36349.

The workflow **build.yml** first launches a job:
- **test-new:** It builds incrementally (using a tox-generated
`Dockerfile` and https://github.com/marketplace/actions/build-and-push-
docker-images) and does the quick incremental test. This completes
within 10 to 20 minutes when there's no change.

After this is completed, more jobs are launched:
- **test-mod:** It again builds incrementally and tests a modularized
distribution. Later (with more from sagemath#35095), more jobs will be added to
this matrix job for other distributions.
- **test-long:** It again builds incrementally and runs the long test.

The workflows **doc-build.yml** and **doc-build-pdf.yml** again build
incrementally and then build the documentation. The diffing code for the
HTML documentation now runs in the host, not the container, which
simplifies things. (To show that diffing still works, we include a small
change to the Sage library.)

Splitting the workflow jobs implements @kwankyu's  suggestion from:
- sagemath#35652 (comment)
(Fixes sagemath#35814)

The steps "again builds incrementally" actually use the GH Actions
cache, https://docs.docker.com/build/ci/github-actions/cache/#cache-
backend-api. When nothing is cached and the 3 workflows are launched in
parallel, they may each build the same thing. But when there's
congestion that leads to the workflows to be run serially, the 2nd and
3rd workflow will be able to use the cache from the 1st workflow. This
elasticity may be helpful in reducing congestion.

There is a rather small per-project limit of 10 GB for this cache, so
we'll have to see how effectively caching works in practice. See
https://github.com/sagemath/sage/actions/caches


<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#36938 (merged here)
- Depends on sagemath#36951 (merged here)
- Depends on sagemath#37351 (merged here)
- Depends on sagemath#37750 (merged here)

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36498
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request May 2, 2024
…arate jobs for pyright, build, modularized tests, long tests

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
Running the containers explicitly, instead of using the declarative
`container:` feature of GH Actions gives us more control:
- we can create more space on the host if necessary; we just scraped by
an out of space condition in sagemath#36473 /
sagemath#36469 (comment)
- we can run some operations outside of the container but in the same
job; this will make the separate "Get CI fixes" jobs unnecessary,
addressing the cosmetic concerns from
sagemath#36338 (comment),
sagemath#36349
- it enables caching between the various workflows (as first discussed
in sagemath#36446).

We split out static type checking with pyright into its separate
workflow:
- **pyright.yml**: As static checking does not need  a build of the Sage
library, for PRs that do not make any changes to packages, there's
nothing to build, and the workflow gives a fast turnaround just after 10
minutes. For applying the CI fixes from blocker tickets, this workflow
uses the technique favored in sagemath#36349.

The workflow **build.yml** first launches a job:
- **test-new:** It builds incrementally (using a tox-generated
`Dockerfile` and https://github.com/marketplace/actions/build-and-push-
docker-images) and does the quick incremental test. This completes
within 10 to 20 minutes when there's no change.

After this is completed, more jobs are launched:
- **test-mod:** It again builds incrementally and tests a modularized
distribution. Later (with more from sagemath#35095), more jobs will be added to
this matrix job for other distributions.
- **test-long:** It again builds incrementally and runs the long test.

The workflows **doc-build.yml** and **doc-build-pdf.yml** again build
incrementally and then build the documentation. The diffing code for the
HTML documentation now runs in the host, not the container, which
simplifies things. (To show that diffing still works, we include a small
change to the Sage library.)

Splitting the workflow jobs implements @kwankyu's  suggestion from:
- sagemath#35652 (comment)
(Fixes sagemath#35814)

The steps "again builds incrementally" actually use the GH Actions
cache, https://docs.docker.com/build/ci/github-actions/cache/#cache-
backend-api. When nothing is cached and the 3 workflows are launched in
parallel, they may each build the same thing. But when there's
congestion that leads to the workflows to be run serially, the 2nd and
3rd workflow will be able to use the cache from the 1st workflow. This
elasticity may be helpful in reducing congestion.

There is a rather small per-project limit of 10 GB for this cache, so
we'll have to see how effectively caching works in practice. See
https://github.com/sagemath/sage/actions/caches


<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->
- Depends on sagemath#36938 (merged here)
- Depends on sagemath#36951 (merged here)
- Depends on sagemath#37351 (merged here)
- Depends on sagemath#37750 (merged here)
- Depends on sagemath#37277 (merged here)

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36498
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI doc-build: Include links to changed HTML files
5 participants