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: Fix test errors involving optional packages coxeter3, ... #36016

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,24 @@ jobs:
run: pyright
working-directory: ./worktree-image

- name: Build (fallback to non-incremental)
id: build
- name: Clean (fallback to non-incremental)
id: clean
if: always() && steps.worktree.outcome == 'success' && steps.incremental.outcome != 'success'
run: |
set -ex
./bootstrap && make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage && ./config.status && make build
./bootstrap && make doc-clean doc-uninstall sagelib-clean && git clean -fx src/sage && ./config.status
working-directory: ./worktree-image
env:
MAKE: make -j2
SAGE_NUM_THREADS: 2

Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this step be placed before the step "Build and test modularized distributions"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I worried that modularized distributions made in the step "Build and test modularized distributions" could be wiped out by the "Clean" step. But they would not. The "Clean" step only cleans up the sage library. Right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is irrelevant. Never mind.

- name: Build
# This step is needed because building the modularized distributions installs some optional packages,
# so the editable install of sagelib needs to build the corresponding optional extension modules.
id: build
if: always() && (steps.incremental.outcome == 'success' || steps.clean.outcome == 'success')
run: |
make build
working-directory: ./worktree-image
Copy link
Collaborator

Choose a reason for hiding this comment

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

You just split make build from the Clean step. How does this make it sure that the "corresponding extension modules" are installed? Prior to that, what do you mean by "corresponding extension modules"? Sorry for naive questions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The "Clean" step is only run when something went wrong in the incremental build.

By splitting out the "make build" step from, this step gets run unconditionally.

In an editable build (default), the Sage library is monolithic: "make sagelib" is responsible for installing all of the Sage library, including the extension modules (Cython modules) that depend on installed optional packages. For example, sage.libs.coxeter3.coxeter.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the explanation.

env:
MAKE: make -j2
Expand All @@ -125,22 +137,22 @@ jobs:
COLUMNS: 120

- name: Test all files (sage -t --all --long)
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
if: always() && steps.build.outcome == 'success'
run: |
../sage -python -m pip install coverage
../sage -python -m coverage run ./bin/sage-runtests --all --long -p2 --random-seed=286735480429121101562228604801325644303
working-directory: ./worktree-image/src

- name: Prepare coverage results
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
if: always() && steps.build.outcome == 'success'
run: |
./venv/bin/python3 -m coverage combine src/.coverage/
./venv/bin/python3 -m coverage xml
find . -name *coverage*
working-directory: ./worktree-image

- name: Upload coverage to codecov
if: always() && (steps.incremental.outcome == 'success' || steps.build.outcome == 'success')
if: always() && steps.build.outcome == 'success'
uses: codecov/codecov-action@v3
with:
files: ./worktree-image/coverage.xml