ci: compliance: Rebase on the target branch before running compliance
Prior to running the compliance checks, we rebase the PR onto the target branch to check the compliance state as if we were merged. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
b3a943d2d5
commit
3bf519de38
1 changed files with 15 additions and 12 deletions
27
.github/workflows/compliance.yml
vendored
27
.github/workflows/compliance.yml
vendored
|
@ -23,6 +23,21 @@ jobs:
|
|||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Rebase onto the target branch
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
run: |
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Your Name"
|
||||
git remote -v
|
||||
# Ensure there's no merge commits in the PR
|
||||
[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
|
||||
(echo "::error ::Merge commits not allowed, rebase instead";false)
|
||||
git rebase origin/${BASE_REF}
|
||||
git clean -f -d
|
||||
# debug
|
||||
git log --pretty=oneline | head -n 10
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
|
@ -42,19 +57,7 @@ jobs:
|
|||
pip3 install west
|
||||
|
||||
- name: west setup
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
run: |
|
||||
git config --global user.email "you@example.com"
|
||||
git config --global user.name "Your Name"
|
||||
git remote -v
|
||||
# Ensure there's no merge commits in the PR
|
||||
[[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \
|
||||
(echo "::error ::Merge commits not allowed, rebase instead";false)
|
||||
git rebase origin/${BASE_REF}
|
||||
git clean -f -d
|
||||
# debug
|
||||
git log --pretty=oneline | head -n 10
|
||||
west init -l . || true
|
||||
west config manifest.group-filter -- +ci,-optional
|
||||
west update -o=--depth=1 -n 2>&1 1> west.update.log || west update -o=--depth=1 -n 2>&1 1> west.update2.log
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue