-
-
Save mtelvers/c08b324cab705cf0ad84f04f3e79a9ab to your computer and use it in GitHub Desktop.
GitHub Action Workflow to rebase a branch
This file contains hidden or 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
| name: Rebase and Test ARM32 | |
| on: | |
| schedule: | |
| - cron: '0 5 * * *' # Daily at 5am UTC | |
| workflow_dispatch: # Manual trigger | |
| jobs: | |
| rebase-test: | |
| runs-on: self-hosted | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: arm32-multicore | |
| - name: Configure git | |
| run: | | |
| git config user.name "CI Bot" | |
| git config user.email "ci@example.com" | |
| - name: Fetch upstream trunk | |
| run: | | |
| git remote add upstream https://github.com/ocaml/ocaml.git || true | |
| git fetch upstream trunk | |
| - name: Rebase onto trunk | |
| id: rebase | |
| run: | | |
| if git rebase upstream/trunk; then | |
| echo "rebase_failed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "rebase_failed=true" >> $GITHUB_OUTPUT | |
| git rebase --abort | |
| fi | |
| - name: Build | |
| if: steps.rebase.outputs.rebase_failed != 'true' | |
| run: | | |
| ./configure | |
| make -j4 world.opt | |
| - name: Test | |
| if: steps.rebase.outputs.rebase_failed != 'true' | |
| run: | | |
| TIMEOUT=900 make tests | |
| - name: Push rebased branch | |
| if: steps.rebase.outputs.rebase_failed != 'true' && github.event_name == 'schedule' | |
| run: | | |
| git push --force origin arm32-multicore | |
| - name: Report rebase failure | |
| if: steps.rebase.outputs.rebase_failed == 'true' | |
| run: | | |
| echo "::error::Rebase failed - manual intervention required" | |
| exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment