6969 id : worktree
7070 run : |
7171 set -ex
72- git config --global user.email "ci-sage@example.com"
73- git config --global user.name "Build & Test workflow"
7472 git config --global --add safe.directory $(pwd)
75- # If actions/checkout downloaded our source tree using the GitHub REST API
76- # instead of with git (because do not have git installed in our image),
77- # we first make the source tree a repo.
78- if [ ! -d .git ]; then git init && git add -A && git commit --quiet -m "new"; fi
79- # Tag this state of the source tree "new". This is what we want to build and test.
80- git tag -f new
81- # Our container image contains a source tree in /sage with a full build of Sage.
82- # But /sage is not a git repository.
83- # We make /sage a worktree whose index is at tag "new".
84- # We then commit the current sources and set the tag "old". (This keeps all mtimes unchanged.)
85- # Then we update worktree and index with "git reset --hard new".
86- # (This keeps mtimes of unchanged files unchanged and mtimes of changed files newer than unchanged files.)
87- # Finally we reset the index to "old". (This keeps all mtimes unchanged.)
88- # The changed files now show up as uncommitted changes.
89- # The final "git add -N" makes sure that files that were added in "new" do not show
90- # as untracked files, which would be removed by "git clean -fx".
91- git worktree add --detach worktree-image
92- rm -rf /sage/.git && mv worktree-image/.git /sage/
93- rm -rf worktree-image && ln -s /sage worktree-image
94- if [ ! -f worktree-image/.gitignore ]; then cp .gitignore worktree-image/; fi
95- (cd worktree-image && git add -A && git commit --quiet --allow-empty -m "old" -a && git tag -f old && git reset --hard new && git reset --quiet old && git add -N . && git status)
73+ .ci/retrofit-worktree.sh worktree-image /sage
9674
9775 - name : Download upstream artifact
9876 uses : actions/download-artifact@v3
@@ -107,20 +85,19 @@ jobs:
10785 (cd worktree-image && git commit -q -m "current changes" --allow-empty -a && git am; git reset --quiet old; git add -N .) < upstream/ci_fixes.patch
10886 fi
10987
110- - name : Incremental build, test changed files (sage -t --new)
88+ - name : Incremental build
11189 id : incremental
11290 run : |
11391 # Now re-bootstrap and build. The build is incremental because we were careful with the timestamps.
114- # We run tests with "sage -t --new"; this only tests the uncommitted changes.
115- ./bootstrap && make build && ./sage -t --new -p2
92+ ./bootstrap && make build
11693 working-directory : ./worktree-image
11794 env :
11895 MAKE : make -j2 --output-sync=recurse
11996 SAGE_NUM_THREADS : 2
12097
121- - name : Build and test modularized distributions
98+ - name : Build modularized distributions
12299 if : always() && steps.worktree.outcome == 'success'
123- run : make V=0 tox && make pypi-wheels
100+ run : make V=0 tox && make SAGE_CHECK=no pypi-wheels
124101 working-directory : ./worktree-image
125102 env :
126103 MAKE : make -j2 --output-sync=recurse
@@ -165,6 +142,26 @@ jobs:
165142 MAKE : make -j2 --output-sync=recurse
166143 SAGE_NUM_THREADS : 2
167144
145+ # Testing
146+
147+ - name : Test changed files (sage -t --new)
148+ if : always() && steps.build.outcome == 'success'
149+ run : |
150+ # We run tests with "sage -t --new"; this only tests the uncommitted changes.
151+ ./sage -t --new -p2
152+ working-directory : ./worktree-image
153+ env :
154+ MAKE : make -j2 --output-sync=recurse
155+ SAGE_NUM_THREADS : 2
156+
157+ - name : Test modularized distributions
158+ if : always() && steps.build.outcome == 'success'
159+ run : make V=0 tox && make pypi-wheels-check
160+ working-directory : ./worktree-image
161+ env :
162+ MAKE : make -j2 --output-sync=recurse
163+ SAGE_NUM_THREADS : 2
164+
168165 - name : Pytest
169166 if : contains(github.ref, 'pytest')
170167 run : |
0 commit comments