-
-
Notifications
You must be signed in to change notification settings - Fork 482
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: improve things around auto-apply of fixes #36349
Changes from all commits
97bfb3a
75324e2
0e7c0a4
43194f8
01678e1
7b12774
b5ee735
e61d557
c729118
66cf6e1
da5d53d
20fb5c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,43 +27,39 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
get_ci_fixes: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/sagemath/sage/sage-${{ github.event.inputs.platform || 'ubuntu-focal-standard' }}-with-targets:${{ github.event.inputs.docker_tag || 'dev'}} | ||
steps: | ||
- name: Install git (macos) | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew update | ||
brew install git | ||
|
||
- name: Install git (linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
apt update | ||
apt install -y git | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, one cannot assume that on Linux, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, it's working, so I call it good enough... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the workflow is run manually, the container can be selected by the user. As you know. |
||
|
||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install GH CLI | ||
uses: dev-hanz-ops/[email protected] | ||
if: ${{ github.event_name == 'pull_request' || github.event.repository.fork }} | ||
with: | ||
gh-cli-version: 2.32.0 | ||
|
||
- name: Merge CI fixes from sagemath/sage | ||
if: ${{ github.event_name == 'pull_request' || github.event.repository.fork }} | ||
run: | | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
.ci/merge-fixes.sh | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Store CI fixes in upstream artifact | ||
run: | | ||
mkdir -p upstream | ||
if git format-patch --stdout test_base > ci_fixes.patch; then | ||
cp ci_fixes.patch upstream/ | ||
fi | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: upstream | ||
name: upstream | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/sagemath/sage/sage-${{ github.event.inputs.platform || 'ubuntu-focal-standard' }}-with-targets:${{ github.event.inputs.docker_tag || 'dev'}} | ||
needs: [get_ci_fixes] | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update system packages | ||
id: prepare | ||
run: | | ||
export PATH="build/bin:$PATH" | ||
eval $(sage-print-system-package-command auto update) | ||
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git) | ||
|
||
- name: Add prebuilt tree as a worktree | ||
id: worktree | ||
|
@@ -72,19 +68,6 @@ jobs: | |
git config --global --add safe.directory $(pwd) | ||
.ci/retrofit-worktree.sh worktree-image /sage | ||
|
||
- name: Download upstream artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: upstream | ||
name: upstream | ||
|
||
- name: Apply CI fixes from sagemath/sage | ||
# After applying the fixes, make sure all changes are marked as uncommitted changes. | ||
run: | | ||
if [ -r upstream/ci_fixes.patch ]; then | ||
(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 | ||
fi | ||
|
||
- name: Incremental build | ||
id: incremental | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,43 +21,46 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
get_ci_fixes: | ||
build-docs-pdf: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/sagemath/sage/sage-${{ github.event.inputs.platform || 'ubuntu-focal-standard' }}-with-targets:${{ github.event.inputs.docker_tag || 'dev'}} | ||
steps: | ||
- name: Install git (macos) | ||
if: runner.os == 'macOS' | ||
tobiasdiez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
brew update | ||
brew install git | ||
|
||
- name: Install git (linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
apt update | ||
apt install -y git | ||
|
||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install GH CLI | ||
uses: dev-hanz-ops/[email protected] | ||
if: ${{ github.event_name == 'pull_request' || github.event.repository.fork }} | ||
with: | ||
gh-cli-version: 2.32.0 | ||
|
||
- name: Merge CI fixes from sagemath/sage | ||
if: ${{ github.event_name == 'pull_request' || github.event.repository.fork }} | ||
run: | | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
.ci/merge-fixes.sh | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Store CI fixes in upstream artifact | ||
run: | | ||
mkdir -p upstream | ||
if git format-patch --stdout test_base > ci_fixes.patch; then | ||
cp ci_fixes.patch upstream/ | ||
fi | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: upstream | ||
name: upstream | ||
|
||
build-docs-pdf: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/sagemath/sage/sage-${{ github.event.inputs.platform || 'ubuntu-focal-standard' }}-with-targets:${{ github.event.inputs.docker_tag || 'dev'}} | ||
needs: [get_ci_fixes] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update system packages | ||
run: | | ||
export PATH="build/bin:$PATH" | ||
eval $(sage-print-system-package-command auto update) | ||
eval $(sage-print-system-package-command auto --yes --no-install-recommends install zip) | ||
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git texlive) | ||
|
||
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install texlive) | ||
|
||
- name: Add prebuilt tree as a worktree | ||
id: worktree | ||
|
@@ -67,19 +70,6 @@ jobs: | |
git config --global user.name "Build & Test workflow" | ||
.ci/retrofit-worktree.sh worktree-image /sage | ||
|
||
- name: Download upstream artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: upstream | ||
name: upstream | ||
|
||
- name: Apply CI fixes from sagemath/sage | ||
# After applying the fixes, make sure all changes are marked as uncommitted changes. | ||
run: | | ||
if [ -r upstream/ci_fixes.patch ]; then | ||
(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 | ||
fi | ||
|
||
- name: Incremental build | ||
id: incremental | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,39 +16,30 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
get_ci_fixes: | ||
build-docs: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/sagemath/sage/sage-ubuntu-focal-standard-with-targets:dev | ||
steps: | ||
- name: Update system packages | ||
run: | | ||
apt-get update && apt-get install -y git zip | ||
|
||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install GH CLI | ||
uses: dev-hanz-ops/[email protected] | ||
if: ${{ github.event_name == 'pull_request' || github.event.repository.fork }} | ||
with: | ||
gh-cli-version: 2.32.0 | ||
|
||
- name: Merge CI fixes from sagemath/sage | ||
if: ${{ github.event_name == 'pull_request' || github.event.repository.fork }} | ||
run: | | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
.ci/merge-fixes.sh | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Store CI fixes in upstream artifact | ||
run: | | ||
mkdir -p upstream | ||
if git format-patch --stdout test_base > ci_fixes.patch; then | ||
cp ci_fixes.patch upstream/ | ||
fi | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: upstream | ||
name: upstream | ||
|
||
build-docs: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/sagemath/sage/sage-ubuntu-focal-standard-with-targets:dev | ||
needs: [get_ci_fixes] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update system packages | ||
run: | | ||
apt-get update && apt-get install -y git zip | ||
|
||
- name: Add prebuilt tree as a worktree | ||
id: worktree | ||
|
@@ -74,19 +65,6 @@ jobs: | |
(echo ".buildinfo"; echo '*.inv'; echo '.git*'; echo '*.svg'; echo '*.pdf'; echo '*.png'; echo 'searchindex.js') > .gitignore; \ | ||
git add -A && git commit --quiet -m "old") | ||
|
||
- name: Download upstream artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: upstream | ||
name: upstream | ||
|
||
- name: Apply CI fixes from sagemath/sage | ||
# After applying the fixes, make sure all changes are marked as uncommitted changes. | ||
run: | | ||
if [ -r upstream/ci_fixes.patch ]; then | ||
(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 | ||
fi | ||
|
||
- name: Incremental build | ||
id: incremental | ||
run: | | ||
|
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.
if one has to use this flag, typically something's wrong already
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 checkout action results in a detached head for PRs. You can call that "wrong" but its by design.