Skip to content

Commit

Permalink
build.yml, doc-build.yml: First create CI fixes as an artifact, so gh…
Browse files Browse the repository at this point in the history
… is not needed in the container
  • Loading branch information
mkoeppe committed Sep 26, 2023
1 parent e4025c1 commit d7c07c0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .ci/merge-fixes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ else
export GIT_AUTHOR_EMAIL="ci-sage@example.com"
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
git tag -f test_base
git commit -q -m "Uncommitted changes" --no-allow-empty -a
for a in $PRs; do
echo "::group::Merging PR https://github.com/$REPO/pull/$a"
Expand All @@ -27,5 +28,5 @@ else
git reset --hard
fi
done
git log test_head..HEAD
git log test_base..HEAD
fi
30 changes: 27 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,33 @@ concurrency:
cancel-in-progress: true

jobs:
build:
get_ci_fixes:
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: Checkout
id: checkout
uses: actions/checkout@v4

- name: Merge CI fixes from sagemath/sage
run: |
.ci/merge-fixes.sh
env:
GH_TOKEN: ${{ github.token }}
- name: Store CI fixes in upstream artifact
run: |
mkdir -p upstream
git format-patch test_base > upstream/ci_fixes.patch
- uses: actions/upload-artifact@v2
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'}}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Update system packages
id: prepare
Expand All @@ -45,6 +59,16 @@ jobs:
eval $(sage-print-system-package-command auto update)
eval $(sage-print-system-package-command auto --spkg --yes --no-install-recommends install git)
- name: Download upstream artifact
uses: actions/download-artifact@v3
with:
path: upstream
name: upstream

- name: Apply CI fixes from sagemath/sage
run: |
if [ -r upstream/ci_fixes.patch ]; then git am < upstream/ci_fixes.patch; fi
- name: Add prebuilt tree as a worktree
id: worktree
run: |
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,40 @@ concurrency:
cancel-in-progress: true

jobs:
build-docs:
get_ci_fixes:
runs-on: ubuntu-latest
container: ghcr.io/sagemath/sage/sage-ubuntu-focal-standard-with-targets:dev
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Merge CI fixes from sagemath/sage
run: |
.ci/merge-fixes.sh
env:
GH_TOKEN: ${{ github.token }}
- name: Store CI fixes in upstream artifact
run: |
mkdir -p upstream
git format-patch test_base > upstream/ci_fixes.patch
- uses: actions/upload-artifact@v2
with:
path: upstream
name: upstream

build-docs:
runs-on: ubuntu-latest
container: ghcr.io/sagemath/sage/sage-ubuntu-focal-standard-with-targets:dev
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update system packages
run: |
apt-get update && apt-get install -y git zip
apt-get update && apt-get install -y git gh zip
- name: Apply CI fixes from sagemath/sage
run: |
if [ -r upstream/ci_fixes.patch ]; then git am < upstream/ci_fixes.patch; fi
- name: Add prebuilt tree as a worktree
id: worktree
Expand Down

0 comments on commit d7c07c0

Please sign in to comment.