Skip to content

Commit 83b1c22

Browse files
authored
Merge pull request #8829 from ellemouton/rebaseItestBeforeRun
.github: rebase before running itests & unit tests
2 parents cf88a8a + e326e24 commit 83b1c22

File tree

2 files changed

+40
-6
lines changed

2 files changed

+40
-6
lines changed

.github/actions/rebase/action.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Rebase on to the PR target base branch"
2+
description: "A reusable workflow that's used to rebase the PR code on to the target base branch."
3+
4+
runs:
5+
using: "composite"
6+
7+
steps:
8+
- name: fetch and rebase on ${{ github.base_ref }}
9+
shell: bash
10+
run: |
11+
git remote add upstream https://github.com/${{ github.repository }}
12+
git fetch upstream ${{ github.base_ref }}:refs/remotes/upstream/${{ github.base_ref }}
13+
export GIT_COMMITTER_EMAIL="[email protected]"
14+
export GIT_COMMITTER_NAME="LND CI"
15+
git rebase upstream/${{ github.base_ref }}

.github/workflows/main.yml

+25-6
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,7 @@ jobs:
103103
go-version: '${{ env.GO_VERSION }}'
104104

105105
- name: fetch and rebase on ${{ github.base_ref }}
106-
run: |
107-
git remote add upstream https://github.com/${{ github.repository }}
108-
git fetch upstream
109-
export GIT_COMMITTER_EMAIL="[email protected]"
110-
export GIT_COMMITTER_NAME="LND CI"
111-
git rebase upstream/${{ github.base_ref }}
106+
uses: ./.github/actions/rebase
112107

113108
- name: check commits
114109
run: scripts/check-each-commit.sh upstream/${{ github.base_ref }}
@@ -200,6 +195,12 @@ jobs:
200195
steps:
201196
- name: git checkout
202197
uses: actions/checkout@v3
198+
with:
199+
fetch-depth: 0
200+
201+
- name: fetch and rebase on ${{ github.base_ref }}
202+
if: github.event_name == 'pull_request'
203+
uses: ./.github/actions/rebase
203204

204205
- name: git checkout fuzzing seeds
205206
uses: actions/checkout@v3
@@ -266,6 +267,12 @@ jobs:
266267
steps:
267268
- name: git checkout
268269
uses: actions/checkout@v3
270+
with:
271+
fetch-depth: 0
272+
273+
- name: fetch and rebase on ${{ github.base_ref }}
274+
if: github.event_name == 'pull_request'
275+
uses: ./.github/actions/rebase
269276

270277
- name: setup go ${{ env.GO_VERSION }}
271278
uses: ./.github/actions/setup-go
@@ -311,6 +318,12 @@ jobs:
311318
steps:
312319
- name: git checkout
313320
uses: actions/checkout@v3
321+
with:
322+
fetch-depth: 0
323+
324+
- name: fetch and rebase on ${{ github.base_ref }}
325+
if: github.event_name == 'pull_request'
326+
uses: ./.github/actions/rebase
314327

315328
- name: setup go ${{ env.GO_VERSION }}
316329
uses: ./.github/actions/setup-go
@@ -349,6 +362,12 @@ jobs:
349362
steps:
350363
- name: git checkout
351364
uses: actions/checkout@v3
365+
with:
366+
fetch-depth: 0
367+
368+
- name: fetch and rebase on ${{ github.base_ref }}
369+
if: github.event_name == 'pull_request'
370+
uses: ./.github/actions/rebase
352371

353372
- name: setup go ${{ env.GO_VERSION }}
354373
uses: ./.github/actions/setup-go

0 commit comments

Comments
 (0)