Skip to content

Commit 746a6fe

Browse files
authored
Fix smoke test failure due to bad git restore post-LKG-deletion (#53156)
1 parent 6e4f0a4 commit 746a6fe

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,21 @@ jobs:
8989

9090
smoke:
9191
runs-on: ubuntu-latest
92+
defaults:
93+
run:
94+
working-directory: ./pr
9295

9396
steps:
9497
- uses: actions/checkout@v3
98+
with:
99+
path: pr
100+
101+
- uses: actions/checkout@v3
102+
with:
103+
path: base
104+
ref: ${{ github.base_ref }}
105+
if: github.event_name == 'pull_request'
106+
95107
- uses: actions/setup-node@v3
96108
with:
97109
node-version: "*"
@@ -100,21 +112,14 @@ jobs:
100112
# Pre-build the base branch so we can check lib folder size changes.
101113
# Note that github.sha points to a merge commit, meaning we're testing
102114
# the base branch versus the base branch with the PR applied.
103-
- if: github.event_name == 'pull_request'
115+
- name: Build base LKG
116+
if: github.event_name == 'pull_request'
104117
run: |
105-
if [ ! -d lib ]; then
106-
git fetch origin ${{ github.base_ref }}
107-
git checkout ${{ github.base_ref }}
108-
npm ci
109-
npx hereby lkg
110-
mkdir /tmp/lkg
111-
mv lib /tmp/lkg/
112-
git restore lib
113-
git clean -fdx lib
114-
git checkout ${{ github.sha }}
115-
rm -rf lib
116-
mv /tmp/lkg/lib .
117-
fi
118+
npm ci
119+
npx hereby lkg
120+
rm -rf $GITHUB_WORKSPACE/pr/lib
121+
mv ./lib $GITHUB_WORKSPACE/pr/
122+
working-directory: ./base
118123

119124
- run: npm ci
120125

0 commit comments

Comments
 (0)