RIP-Comm / clementine

Gameboy Advance emulator.
MIT License
49 stars 13 forks source link

PR CI: Add check on rebase #100

Closed AlessioC31 closed 1 year ago

AlessioC31 commented 1 year ago

We currently have checks (fmt, test, lint) on PR branches. It would be useful to execute the same set of checks on the "potential" new main branch (PR branch rebased to current main).

This is useful because the PR branch may be not rebased to the main, thus merging the PR could result in broken tests.

AlessioC31 commented 1 year ago

Another option could be to disable merging the PR if it is not rebased on main. If we go for this we could enable some actions that automatically rebase PRs when you comment "/rebase" or something like that.

Let's use this issue to discuss :)

@guerinoni

guerinoni commented 1 year ago

Something simple like

command:
      - |
          before=\$(git rev-parse HEAD)
          echo "Before: \$before"
          echo Rebasing main into PR branch...
          git rebase main --message 'Automatic rebase main for PR branch'
          after=\$(git rev-parse HEAD)
          echo "After: \$after"

          [[ \$before == \$after ]] || run_test
AlessioC31 commented 1 year ago

Closing since it looks like merge queues solve this problem