diff --git a/.ci/merge-fixes.sh b/.ci/merge-fixes.sh index 8ee138660ec..b3ad66cb013 100755 --- a/.ci/merge-fixes.sh +++ b/.ci/merge-fixes.sh @@ -19,7 +19,7 @@ else git tag -f test_head $GH pr checkout -b pr-$a $a git checkout -q test_head - if git merge --no-edit --squash -q pr-$a; then + if git merge --no-edit --squash --allow-unrelated-histories -q pr-$a; then echo "::endgroup::" if git commit -q -m "Merge https://github.com/$REPO/pull/$a" -a --no-allow-empty; then echo "Merged #$a" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f466d3a285..b504adb2913 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 + - name: Checkout id: checkout uses: actions/checkout@v4 + + - name: Install GH CLI + uses: dev-hanz-ops/install-gh-cli-action@v0.1.0 + 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: | diff --git a/.github/workflows/ci-conda.yml b/.github/workflows/ci-conda.yml index 2240c224a52..97a535239e4 100644 --- a/.github/workflows/ci-conda.yml +++ b/.github/workflows/ci-conda.yml @@ -34,6 +34,7 @@ jobs: - uses: actions/checkout@v4 - name: Merge CI fixes from sagemath/sage + if: ${{ github.event_name == 'pull_request' || github.event.repository.fork }} run: | .ci/merge-fixes.sh env: diff --git a/.github/workflows/doc-build-pdf.yml b/.github/workflows/doc-build-pdf.yml index 1d14d0c29f7..d220c3280c5 100644 --- a/.github/workflows/doc-build-pdf.yml +++ b/.github/workflows/doc-build-pdf.yml @@ -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' + 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/install-gh-cli-action@v0.1.0 + 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: | diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 3660ff3a947..34190314490 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -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/install-gh-cli-action@v0.1.0 + 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: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 41560674b49..e906c00512f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,6 +22,7 @@ jobs: uses: actions/checkout@v4 - name: Merge CI fixes from sagemath/sage + if: ${{ github.event_name == 'pull_request' || github.event.repository.fork }} run: | .ci/merge-fixes.sh env: