From 746a6feb2e7ba6987b6c72db538dd498b35cd461 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Tue, 7 Mar 2023 17:15:10 -0800 Subject: [PATCH] Fix smoke test failure due to bad git restore post-LKG-deletion (#53156) --- .github/workflows/ci.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff913ab1da0..2d52e2b6fa1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,9 +89,21 @@ jobs: smoke: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./pr steps: - uses: actions/checkout@v3 + with: + path: pr + + - uses: actions/checkout@v3 + with: + path: base + ref: ${{ github.base_ref }} + if: github.event_name == 'pull_request' + - uses: actions/setup-node@v3 with: node-version: "*" @@ -100,21 +112,14 @@ jobs: # Pre-build the base branch so we can check lib folder size changes. # Note that github.sha points to a merge commit, meaning we're testing # the base branch versus the base branch with the PR applied. - - if: github.event_name == 'pull_request' + - name: Build base LKG + if: github.event_name == 'pull_request' run: | - if [ ! -d lib ]; then - git fetch origin ${{ github.base_ref }} - git checkout ${{ github.base_ref }} - npm ci - npx hereby lkg - mkdir /tmp/lkg - mv lib /tmp/lkg/ - git restore lib - git clean -fdx lib - git checkout ${{ github.sha }} - rm -rf lib - mv /tmp/lkg/lib . - fi + npm ci + npx hereby lkg + rm -rf $GITHUB_WORKSPACE/pr/lib + mv ./lib $GITHUB_WORKSPACE/pr/ + working-directory: ./base - run: npm ci