@@ -23,22 +23,30 @@ jobs:
2323 macos_dev_target : 14.0
2424 arch : arm64
2525 python-arch : arm64
26+ enable_pch : ON
2627 run_regressions : true
2728 pretty : " Mac arm64"
2829 - os : ubuntu-24.04
2930 arch : x86_64
3031 python-arch : x64
32+ enable_pch : ON
3133 run_regressions : true
3234 pretty : " Ubuntu 24.04"
3335 - os : windows-2022
3436 arch : x86_64
3537 python-arch : x64
38+ enable_pch : OFF
3639 run_regressions : false
3740 pretty : " Windows x64"
3841
3942 steps :
4043
41- - uses : actions/checkout@v6
44+ - name : Checkout PR head
45+ uses : actions/checkout@v6
46+ with :
47+ repository : ${{ github.event.pull_request.head.repo.full_name }}
48+ ref : ${{ github.event.pull_request.head.sha }}
49+ fetch-depth : 0
4250
4351 - name : Setup System
4452 id : setup-runner
@@ -50,21 +58,26 @@ jobs:
5058 - name : Get Develop and Branch Git SHA
5159 shell : bash
5260 run : |
53- echo "Figuring out the develop GIT SHA"
54- # github.event.pull_request.base.sha points to develop at the time the PR was created, not the current one
55- DEVELOP_SHA=$(git ls-remote https://github.com/$GITHUB_REPOSITORY.git develop | cut -f1 | cut -c1-10)
56- echo "Develop GIT SHA is '${DEVELOP_SHA}'"
61+ echo "Figuring out the develop GIT SHA already merged into the PR branch"
62+ BASE_BRANCH="${{ github.base_ref }}"
63+ if git remote get-url upstream >/dev/null 2>&1; then
64+ git remote set-url upstream "https://github.com/$GITHUB_REPOSITORY.git"
65+ else
66+ git remote add upstream "https://github.com/$GITHUB_REPOSITORY.git"
67+ fi
68+ git fetch --no-tags upstream "refs/heads/${BASE_BRANCH}:refs/remotes/upstream/${BASE_BRANCH}"
69+ DEVELOP_SHA=$(git merge-base HEAD "upstream/${BASE_BRANCH}")
70+ echo "Develop GIT SHA merged into this branch is '${DEVELOP_SHA}'"
5771 echo "DEVELOP_SHA=$DEVELOP_SHA" >> $GITHUB_ENV
5872
5973 CURRENT_HEAD_SHA=${{ github.event.pull_request.head.sha }}
6074 echo "Current Branch HEAD SHA is '${CURRENT_HEAD_SHA}'"
61- echo "CURRENT_HEAD_SHA=$DEVELOP_SHA " >> $GITHUB_ENV
75+ echo "CURRENT_HEAD_SHA=$CURRENT_HEAD_SHA " >> $GITHUB_ENV
6276
63- echo "Current merge commit SHA is '${GITHUB_SHA}'"
77+ echo "GitHub synthetic merge commit SHA is '${GITHUB_SHA}'"
6478 echo "::endgroup::"
65- # We default to using PCH, in case we don't find the baseline reg tests,
66- # since it speeds up the build significantly and we'll build TWICE
67- echo "ENABLE_PCH=ON" >> $GITHUB_ENV
79+ # Default PCH behavior is per-platform, then regression-cache hits may override it.
80+ echo "ENABLE_PCH=${{ matrix.enable_pch }}" >> $GITHUB_ENV
6881
6982 - name : Baseline Regression Testing caching
7083 uses : actions/cache@v5
92105 restore-keys : |
93106 ccache-${{ matrix.os }}-${{ steps.setup-runner.outputs.compiler-id }}-${{ github.head_ref }}
94107 ccache-${{ matrix.os }}-${{ steps.setup-runner.outputs.compiler-id }}-${{ env.DEVELOP_SHA }}
95- ccache-${{ matrix.os }}-${{ steps.setup-runner.outputs.compiler-id }}-
96- ccache-${{ matrix.os }}-
97108
98109 - name : Did restoring the CCache-cache work?
99110 shell : bash
@@ -140,7 +151,8 @@ jobs:
140151 if : matrix.run_regressions && steps.cachebaselineregression.outputs.cache-hit != 'true'
141152 uses : actions/checkout@v6
142153 with :
143- ref : develop
154+ repository : ${{ github.repository }}
155+ ref : ${{ env.DEVELOP_SHA }}
144156 clean : false # Do NOT wipe the build/ and .ccache folder (`git clean -ffdx && git reset --hard HEAD`)
145157
146158 - name : Baseline Configure and Build
@@ -184,6 +196,8 @@ jobs:
184196 if : matrix.run_regressions && steps.cachebaselineregression.outputs.cache-hit != 'true'
185197 uses : actions/checkout@v6
186198 with :
199+ repository : ${{ github.event.pull_request.head.repo.full_name }}
200+ ref : ${{ env.CURRENT_HEAD_SHA }}
187201 clean : false # Do NOT wipe the build/ and .ccache folder (`git clean -ffdx && git reset --hard HEAD`)
188202
189203 - name : Install problem matcher
0 commit comments