Skip to content

Commit 743bcc7

Browse files
committed
test workflow
1 parent 012b424 commit 743bcc7

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/docker-unified.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ env:
2929
PROFILE_NAME: "${{ github.event.inputs.profileName || 'quickstart-consumers' }}"
3030

3131
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 }}
3335
DEPOT_TOKEN: "${{ secrets.DEPOT_TOKEN }}"
3436

3537
permissions:
@@ -135,22 +137,25 @@ jobs:
135137
- name: Determine runner type
136138
id: set-runner
137139
# 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.
142144
# Depot is used here for remote container builds in base_build and also for all runners. Depot runners support unlimited concurrency
143145
# and hence short queue times and higher parallelism of smoke tests
144-
145146
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
147148
echo "build_runner_type=depot-ubuntu-24.04-4" >> "$GITHUB_OUTPUT"
148149
echo "test_runner_type=depot-ubuntu-24.04-4" >> "$GITHUB_OUTPUT"
149150
echo "test_runner_type_small=depot-ubuntu-24.04-small" >> "$GITHUB_OUTPUT"
150151
echo "use_depot_cache=true" >> "$GITHUB_OUTPUT"
151152
else
152153
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
154159
echo "test_runner_type_small=ubuntu-latest" >> "$GITHUB_OUTPUT"
155160
echo "use_depot_cache=false" >> "$GITHUB_OUTPUT"
156161
# publishing is currently only supported via depot
@@ -392,7 +397,7 @@ jobs:
392397
# python_batch_count is used to split pytests in the smoke-test (batches of actual test functions)
393398
# cypress_batch_count is used to split the collection of cypress test specs into batches.
394399
run: |
395-
if [[ "${{ needs.setup.outputs.test_runner_type }}" == "ubuntu-latest" ]]; then
400+
if [[ "${{ env.IS_FORK }}" == "true" ]]; then
396401
echo "cypress_batch_count=5" >> "$GITHUB_OUTPUT"
397402
echo "python_batch_count=3" >> "$GITHUB_OUTPUT"
398403
else

0 commit comments

Comments
 (0)