-
-
Notifications
You must be signed in to change notification settings - Fork 553
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: Migrate test-new to meson #39641
Open
tobiasdiez
wants to merge
8
commits into
sagemath:develop
Choose a base branch
from
tobiasdiez:migrate-ci-meson
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
65b9871
Migrate test-new to meson
tobiasdiez 1f4138d
Show remotes for debugging purposes
tobiasdiez 6d42708
Fix reset to develop branch
tobiasdiez 200ea1b
Fetch origin before reset
tobiasdiez a7e37ef
Restore docker push but disable gha cache
tobiasdiez 8fc3eae
Suppress pytest collections errors again
tobiasdiez db35923
Merge branch 'develop' into migrate-ci-meson
tobiasdiez b9feb17
Fix CI run name
tobiasdiez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,23 +14,31 @@ concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Conda (${{ matrix.os }}, Python ${{ matrix.python }}${{ matrix.editable && ', editable' || '' }}) | ||
name: Conda (${{ matrix.os }}, Python ${{ matrix.python }}, ${{ matrix.tests }}${{ matrix.editable && ', editable' || '' }}) | ||
runs-on: ${{ matrix.os }}-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu] | ||
os: ['ubuntu'] | ||
python: ['3.11', '3.12'] | ||
tests: ['all'] | ||
editable: | ||
${{ fromJson(github.event_name == 'pull_request' && '[false]' || '[false, true]') }} | ||
include: | ||
- os: 'ubuntu' | ||
python: '3.12' | ||
tests: 'new' | ||
# one additional editable run in pull_request, this has no effect if not pull_request | ||
- os: ubuntu | ||
- os: 'ubuntu' | ||
python: 3.12 | ||
editable: true | ||
tests: 'all' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -41,6 +49,17 @@ jobs: | |
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: Mark new files as uncommited | ||
if: matrix.tests == 'new' | ||
run: | | ||
# List remotes (for debugging) | ||
git remote -v | ||
# Reset the branch to develop | ||
git fetch origin develop | ||
git reset --soft origin/develop | ||
# Show uncommitted changes | ||
git status | ||
|
||
- name: Cache conda packages | ||
uses: actions/cache@v4 | ||
with: | ||
|
@@ -83,6 +102,7 @@ jobs: | |
# this step must be after build, because meson.build creates a number of __init__.py files | ||
# that is needed to make tools/update-meson.py run correctly | ||
shell: bash -l {0} | ||
if: matrix.tests == 'all' | ||
run: | | ||
python3 tools/update-meson.py | ||
if ! ./tools/test-git-no-uncommitted-changes; then | ||
|
@@ -103,7 +123,17 @@ jobs: | |
# If editable then deleting the directory will cause sage to detect rebuild, which will cause ninja to fail | ||
# so we don't delete the directory in this case | ||
${{ matrix.editable && 'true' || 'rm -R ./src/sage_setup/' }} | ||
./sage -t --all -p4 --format github | ||
./sage -t --${{ matrix.tests }} -p4 --format github | ||
|
||
- name: Check that all modules can be imported | ||
shell: bash -l {0} | ||
run: | | ||
# Increase the length of the lines in the "short summary" | ||
export COLUMNS=120 | ||
# The following command checks that all modules can be imported. | ||
# The output also includes a long list of modules together with the number of tests in each module. | ||
# This can be ignored. | ||
pytest -qq --doctest --collect-only || true | ||
|
||
- name: Upload log | ||
uses: actions/[email protected] | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't remove this defeat the whole point of test-new? (that you do a fast-fail when there's a trivial error to notify the pull request author to fix it, so you don't burn CPU on testing the rest of the files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main point of
test-new
is that it provides quick feedback for devs. But I'm planning to also move these "long" tests to meson in a follow-up and then it's indeed a good idea to make run only after all other normal tests were passing.