|
29 | 29 | PROFILE_NAME: "${{ github.event.inputs.profileName || 'quickstart-consumers' }}" |
30 | 30 |
|
31 | 31 | DOCKER_CACHE: "DEPOT" |
32 | | - DEPOT_PROJECT_ID: "${{ vars.DEPOT_PROJECT_ID }}" |
| 32 | + DEPOT_PROJECT_ID: "s0gr1cr3jd" |
| 33 | + HAS_DEPOT_LABEL: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'depot') }} |
| 34 | + IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} |
33 | 35 | DEPOT_TOKEN: "${{ secrets.DEPOT_TOKEN }}" |
34 | 36 |
|
35 | 37 | permissions: |
@@ -135,22 +137,25 @@ jobs: |
135 | 137 | - name: Determine runner type |
136 | 138 | id: set-runner |
137 | 139 | # This needs to handle two scenarios: |
138 | | - # 1. Running on a PR from a fork. There are some auth issues that prevent us from using depot in that case. |
139 | | - # So, Its easier to just use the regular github actions cache and build all images for each parallel job running smoke test. |
140 | | - # Note, concurrency is lower when using github runners, queue times can be longer, test time is longer due to fewer parallel jobs. |
141 | | - # 2. Running on a PR from a branch in the datahub-project org and push/schedule events on master. |
| 140 | + # 1. Running on a PR from a fork. We use github runners, unless the "depot" label exists -- in which case, we run |
| 141 | + # it on depotNote, concurrency is lower when using github runners, queue times can be longer, test time is longer |
| 142 | + # due to fewer parallel jobs. |
| 143 | + # 3. Running on a PR from a branch in the datahub-project org and push/schedule events on master. |
142 | 144 | # Depot is used here for remote container builds in base_build and also for all runners. Depot runners support unlimited concurrency |
143 | 145 | # and hence short queue times and higher parallelism of smoke tests |
144 | | - |
145 | 146 | run: | |
146 | | - if [[ "${{ env.DOCKER_CACHE }}" == "DEPOT" && "${{ env.DEPOT_PROJECT_ID }}" != "" ]]; then |
| 147 | + if [[ "${{ env.DOCKER_CACHE }}" == "DEPOT" && ( "${{ env.IS_FORK }}" == "false" || "${{ env.HAS_DEPOT_LABEL }}" == "true" ) ]]; then |
147 | 148 | echo "build_runner_type=depot-ubuntu-24.04-4" >> "$GITHUB_OUTPUT" |
148 | 149 | echo "test_runner_type=depot-ubuntu-24.04-4" >> "$GITHUB_OUTPUT" |
149 | 150 | echo "test_runner_type_small=depot-ubuntu-24.04-small" >> "$GITHUB_OUTPUT" |
150 | 151 | echo "use_depot_cache=true" >> "$GITHUB_OUTPUT" |
151 | 152 | else |
152 | 153 | echo "build_runner_type=ubuntu-latest" >> "$GITHUB_OUTPUT" |
153 | | - echo "test_runner_type=ubuntu-latest" >> "$GITHUB_OUTPUT" |
| 154 | + if [[ "${{ env.HAS_DEPOT_LABEL }}" == "true" ]]; then |
| 155 | + echo "test_runner_type=depot-ubuntu-24.04-4" >> "$GITHUB_OUTPUT" |
| 156 | + else |
| 157 | + echo "test_runner_type=ubuntu-latest" >> "$GITHUB_OUTPUT" |
| 158 | + fi |
154 | 159 | echo "test_runner_type_small=ubuntu-latest" >> "$GITHUB_OUTPUT" |
155 | 160 | echo "use_depot_cache=false" >> "$GITHUB_OUTPUT" |
156 | 161 | # publishing is currently only supported via depot |
@@ -392,7 +397,7 @@ jobs: |
392 | 397 | # python_batch_count is used to split pytests in the smoke-test (batches of actual test functions) |
393 | 398 | # cypress_batch_count is used to split the collection of cypress test specs into batches. |
394 | 399 | run: | |
395 | | - if [[ "${{ needs.setup.outputs.test_runner_type }}" == "ubuntu-latest" ]]; then |
| 400 | + if [[ "${{ env.IS_FORK }}" == "true" ]]; then |
396 | 401 | echo "cypress_batch_count=5" >> "$GITHUB_OUTPUT" |
397 | 402 | echo "python_batch_count=3" >> "$GITHUB_OUTPUT" |
398 | 403 | else |
|
0 commit comments