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