Skip to content

Commit 5e73cf0

Browse files
committed
feat: include alttester on all non release builds
1 parent 597dd95 commit 5e73cf0

File tree

14 files changed

+5708
-351
lines changed

14 files changed

+5708
-351
lines changed

.github/workflows/build-unitycloud.yml

Lines changed: 29 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ concurrency:
136136
github.event_name != 'pull_request' ||
137137
github.event.action != 'labeled' ||
138138
github.event.label.name == 'force-build' ||
139-
github.event.label.name == 'clean-build' ||
140-
github.event.label.name == 'automation-tests'
139+
github.event.label.name == 'clean-build'
141140
}}
142141
143142
jobs:
@@ -163,14 +162,12 @@ jobs:
163162
github.event.action == 'ready_for_review' ||
164163
(
165164
github.event.action == 'labeled' &&
166-
(github.event.label.name == 'force-build' || github.event.label.name == 'clean-build' || github.event.label.name == 'automation-tests')
165+
(github.event.label.name == 'force-build' || github.event.label.name == 'clean-build')
167166
)
168167
)
169168
)
170169
)
171170
outputs:
172-
should_build: ${{ steps.decide.outputs.should_build }}
173-
alttester_build: ${{ steps.decide.outputs.alttester_build }}
174171
commit_sha: ${{ steps.get_commit_sha.outputs.commit_sha }}
175172
options: ${{ steps.get_options.outputs.options }}
176173
version: ${{ github.event.inputs.version || inputs.version || steps.get_version.outputs.full_version }}
@@ -199,54 +196,43 @@ jobs:
199196
run: |
200197
set -euo pipefail
201198
202-
should_build=false
203-
alttester_build=false
204-
205199
# Non-PR triggers that reached prebuild => build
206200
echo "[check non-PR] event_name='${{ github.event_name }}' != 'pull_request'"
207201
if [ "${{ github.event_name }}" != "pull_request" ]; then
208-
echo "[non-PR] TRUE -> should_build=true"
209-
should_build=true
210-
else
211-
labels="${{ join(github.event.pull_request.labels.*.name, ' ') }}"
212-
echo "labels='$labels'"
202+
echo "[non-PR] TRUE -> should_build=true -> exiting 0"
203+
exit 0
204+
fi
213205
214-
# Check for automation-tests label
215-
echo "$labels" | grep -qw 'automation-tests' && alttester_build=true
216-
echo "alttester_build='$alttester_build'"
206+
labels="${{ join(github.event.pull_request.labels.*.name, ' ') }}"
207+
echo "labels='$labels'"
217208
218-
has_override=false
219-
echo "[check override] searching for 'force-build|clean-build' in labels"
220-
echo "$labels" | grep -qwE 'force-build|clean-build' && has_override=true
209+
has_override=false
210+
echo "[check override] searching for 'force-build|clean-build' in labels"
211+
echo "$labels" | grep -qwE 'force-build|clean-build' && has_override=true
221212
222-
echo "has_override='$has_override'"
223-
if [ "$has_override" = "true" ]; then
224-
echo "[override] TRUE -> should_build=true"
225-
should_build=true
226-
else
227-
is_draft="${{ github.event.pull_request.draft }}"
228-
echo "[check draft] is_draft='$is_draft'"
229-
if [ "$is_draft" != "true" ]; then
230-
explorer_changed="${{ steps.changed_explorer.outputs.any_changed }}"
231-
echo "[check explorer_changed] explorer_changed='$explorer_changed'"
232-
if [ "$explorer_changed" = "true" ]; then
233-
echo "[explorer_changed] TRUE -> should_build=true"
234-
should_build=true
235-
fi
236-
fi
237-
fi
213+
echo "has_override='$has_override'"
214+
if [ "$has_override" = "true" ]; then
215+
echo "[override] TRUE -> should_build=true -> exiting 0"
216+
exit 0
238217
fi
239218
240-
echo "should_build=$should_build" >> $GITHUB_OUTPUT
241-
echo "alttester_build=$alttester_build" >> $GITHUB_OUTPUT
242-
243-
# If neither build is needed, fail to skip downstream jobs
244-
if [ "$should_build" = "false" ] && [ "$alttester_build" = "false" ]; then
245-
echo "No builds needed, skipping"
219+
# If still draft and no override => do not build
220+
is_draft="${{ github.event.pull_request.draft }}"
221+
echo "[check draft] is_draft='$is_draft'"
222+
if [ "$is_draft" = "true" ]; then
223+
echo "[draft] TRUE -> should_build=false -> exiting 1"
246224
exit 1
247225
fi
248226
249-
echo "should_build=$should_build, alttester_build=$alttester_build"
227+
explorer_changed="${{ steps.changed_explorer.outputs.any_changed }}"
228+
echo "[check explorer_changed] explorer_changed='$explorer_changed'"
229+
if [ "$explorer_changed" = "true" ]; then
230+
echo "[explorer_changed] TRUE -> should_build=true -> exiting 0"
231+
exit 0
232+
fi
233+
234+
echo "[explorer_changed] FALSE -> should_build=false -> exiting 1"
235+
exit 1
250236
251237
- name: Get commit SHA
252238
id: get_commit_sha
@@ -366,7 +352,6 @@ jobs:
366352
name: Build
367353
runs-on: ubuntu-latest
368354
needs: prebuild
369-
if: needs.prebuild.outputs.should_build == 'true'
370355
timeout-minutes: 360
371356
strategy:
372357
fail-fast: false
@@ -428,6 +413,7 @@ jobs:
428413
PARAM_SENTRY_ENABLED: ${{ needs.prebuild.outputs.sentry_enabled }}
429414
PARAM_SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
430415
PARAM_INSTALL_SOURCE: ${{ needs.prebuild.outputs.install_source }}
416+
PARAM_IS_RELEASE_BUILD: ${{ inputs.is_release_build }}
431417
PARAM_UNITY_EXTRA_PARAMS: '-disable-assembly-updater'
432418

433419
- name: 'Tar artifact to maintain original permissions'
@@ -715,119 +701,3 @@ jobs:
715701
ORG_ID: ${{ secrets.UNITY_CLOUD_ORG_ID }}
716702
PROJECT_ID: ${{ secrets.UNITY_CLOUD_PROJECT_ID }}
717703
run: python -u scripts/cloudbuild/build.py --cancel
718-
719-
build-alttester:
720-
name: Build (AltTester)
721-
runs-on: ubuntu-latest
722-
needs: prebuild
723-
if: needs.prebuild.outputs.alttester_build == 'true'
724-
timeout-minutes: 360
725-
steps:
726-
- name: Checkout code
727-
uses: actions/checkout@v4
728-
with:
729-
fetch-depth: 0
730-
ref: ${{ github.event.pull_request.head.ref || github.ref_name }}
731-
732-
- name: Setup python
733-
uses: actions/setup-python@v5
734-
with:
735-
python-version: 3.12.3
736-
737-
- name: Install dependencies
738-
run: |
739-
python -m pip install --upgrade pip
740-
pip install -r scripts/cloudbuild/requirements.txt
741-
742-
- name: Execute Unity Cloud build (AltTester instrumented)
743-
uses: nick-fields/retry@v3
744-
with:
745-
timeout_minutes: 180
746-
max_attempts: 2
747-
retry_on_exit_code: 99
748-
retry_wait_seconds: 30
749-
on_retry_command: |
750-
echo "::warning::🔁 Unity Cloud Build (AltTester) retry triggered at $(date '+%Y-%m-%d %H:%M:%S')"
751-
command: |
752-
echo "🔧 Starting Unity Cloud Build (AltTester) attempt at $(date '+%Y-%m-%d %H:%M:%S')"
753-
python -u scripts/cloudbuild/build.py
754-
env:
755-
API_KEY: ${{ secrets.UNITY_CLOUD_API_KEY }}
756-
ORG_ID: ${{ secrets.UNITY_CLOUD_ORG_ID }}
757-
PROJECT_ID: ${{ secrets.UNITY_CLOUD_PROJECT_ID }}
758-
POLL_TIME: 60
759-
GLOBAL_TIMEOUT: 10800
760-
TARGET: t_windows64
761-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
762-
COMMIT_SHA: ${{ needs.prebuild.outputs.commit_sha }}
763-
BUILD_OPTIONS: 'Development,CompressWithLz4HC'
764-
CLEAN_BUILD: false
765-
CACHE_STRATEGY: ${{ needs.prebuild.outputs.cache_strategy }}
766-
IS_RELEASE_BUILD: false
767-
TARGET_NAME_SUFFIX: alttester
768-
PARAM_BUILD_VERSION: ${{ needs.prebuild.outputs.version }}
769-
PARAM_SENTRY_ENABLED: false
770-
PARAM_INSTALL_SOURCE: launcher
771-
PARAM_ALTTESTER_BUILD: 'true'
772-
PARAM_UNITY_EXTRA_PARAMS: '-disable-assembly-updater'
773-
774-
- name: Upload artifact
775-
uses: actions/upload-artifact@v4
776-
with:
777-
name: Decentraland_windows64_alttester
778-
path: |
779-
build
780-
!build/**/*_BackUpThisFolder_ButDontShipItWithYourGame
781-
!build/**/*_BurstDebugInformation_DoNotShip
782-
if-no-files-found: error
783-
784-
- name: Set SHA and branch
785-
run: |
786-
echo "SHA_SHORT=$(echo ${{ needs.prebuild.outputs.commit_sha }} | cut -c1-7)" >> $GITHUB_ENV
787-
echo "SAFE_BRANCH_NAME=${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}" >> $GITHUB_ENV
788-
789-
- name: Compress and upload to S3
790-
env:
791-
AWS_ACCESS_KEY_ID: ${{ secrets.EXPLORER_TEAM_AWS_ACCESS_KEY_ID }}
792-
AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPLORER_TEAM_AWS_SECRET_ACCESS_KEY }}
793-
EXPLORER_TEAM_S3_BUCKET: ${{ secrets.EXPLORER_TEAM_S3_BUCKET }}
794-
DESTINATION_PATH: "@dcl/${{ github.event.repository.name }}/branch/${{ env.SAFE_BRANCH_NAME }}/pr-${{ github.run_number }}-${{ env.SHA_SHORT }}"
795-
run: |
796-
mkdir -p upload_to_s3
797-
cd build
798-
zip -r ../upload_to_s3/Decentraland_windows64_alttester.zip . \
799-
-x "*_BackUpThisFolder_ButDontShipItWithYourGame**" \
800-
-x "*_BurstDebugInformation_DoNotShip**"
801-
cd ..
802-
npx @dcl/cdn-uploader@next \
803-
--bucket $EXPLORER_TEAM_S3_BUCKET \
804-
--local-folder upload_to_s3 \
805-
--bucket-folder $DESTINATION_PATH
806-
807-
# Will run always (even if failing)
808-
- name: Upload cloud logs
809-
if: always()
810-
uses: actions/upload-artifact@v4
811-
with:
812-
name: windows64_alttester_unity_log
813-
path: unity_cloud_log.log
814-
if-no-files-found: error
815-
816-
- name: Print cloud logs
817-
if: always()
818-
run: cat unity_cloud_log.log
819-
820-
- name: Extract and display errors
821-
if: always()
822-
run: |
823-
echo "=== Extracted Errors for windows64 alttester ==="
824-
grep -iE "error c|fatal" unity_cloud_log.log | sed 's/^/\x1b[31m/' | sed 's/$/\x1b[0m/' || echo "No 'error c' or 'fatal' errors found in alttester log."
825-
826-
# Will run on cancel or timeout only
827-
- name: Cancel Unity Cloud build
828-
if: ${{ cancelled() }}
829-
env:
830-
API_KEY: ${{ secrets.UNITY_CLOUD_API_KEY }}
831-
ORG_ID: ${{ secrets.UNITY_CLOUD_ORG_ID }}
832-
PROJECT_ID: ${{ secrets.UNITY_CLOUD_PROJECT_ID }}
833-
run: python -u scripts/cloudbuild/build.py --cancel

.github/workflows/pr-comment-artifact-url.yml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,6 @@ jobs:
7272
echo "Mac Artifact ID: $MAC_ARTIFACT_ID"
7373
echo "MAC_ARTIFACT_ID=$MAC_ARTIFACT_ID" >> "$GITHUB_ENV"
7474
75-
ALTTESTER_ARTIFACT_ID=$(gh api "/repos/$OWNER/$REPO/actions/artifacts" \
76-
--jq ".artifacts.[] |
77-
select(.workflow_run.id==${PREVIOUS_JOB_ID}) |
78-
select(.expired==false) |
79-
select(.name==\"Decentraland_windows64_alttester\") |
80-
.id")
81-
echo "AltTester Artifact ID: $ALTTESTER_ARTIFACT_ID"
82-
echo "ALTTESTER_ARTIFACT_ID=$ALTTESTER_ARTIFACT_ID" >> "$GITHUB_ENV"
83-
8475
ORIGINAL_EVENT=$(jq -r '.event' <<< "$WORKFLOW_RUN_EVENT_OBJ")
8576
echo "Original Event: $ORIGINAL_EVENT"
8677
@@ -160,23 +151,6 @@ jobs:
160151
issue-number: ${{ needs.pre-validation.outputs.pr-number }}
161152
comment-author: 'github-actions[bot]'
162153

163-
- name: Build AltTester rows
164-
id: alttester-rows
165-
env:
166-
ALTTESTER_ARTIFACT_URL: "${{ github.server_url }}/${{ github.repository }}/suites/${{ env.SUITE_ID }}/artifacts/${{ env.ALTTESTER_ARTIFACT_ID }}"
167-
ALTTESTER_ARTIFACT_S3_URL: "${{ format('{0}/{1}/Decentraland_windows64_alttester.zip', vars.EXPLORER_TEAM_S3_BUCKET_PUBLIC_URL, env.ARTIFACT_S3_DESTINATION_PATH) }}"
168-
run: |
169-
if [ -n "${{ env.ALTTESTER_ARTIFACT_ID }}" ]; then
170-
{
171-
echo "ALTTESTER_ROWS<<EOF"
172-
echo "| Download AltTester Windows | $ALTTESTER_ARTIFACT_URL |"
173-
echo "| Download AltTester Windows S3 | $ALTTESTER_ARTIFACT_S3_URL |"
174-
echo "EOF"
175-
} >> "$GITHUB_ENV"
176-
else
177-
echo "ALTTESTER_ROWS=" >> "$GITHUB_ENV"
178-
fi
179-
180154
- name: Update Comment
181155
env:
182156
JOB_PATH: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ env.PREVIOUS_JOB_ID }}"
@@ -203,7 +177,6 @@ jobs:
203177
| Download Windows S3 | ${{ env.WINDOWS_ARTIFACT_S3_URL }} |
204178
| Download Mac | ${{ env.MAC_ARTIFACT_URL }} |
205179
| Download Mac S3 | ${{ env.MAC_ARTIFACT_S3_URL }} |
206-
${{ env.ALTTESTER_ROWS }}
207180
| Built on | ${{ env.BUILD_DATE }} |
208181
209182
${{ env.SIZE_REPORT }}

Explorer/Assets/DCL/Infrastructure/Global/AppArgs/AppArgsFlags.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public static class AppArgsFlags
8585
public const string GLIDING = "gliding";
8686

8787
public const string MULTIPLE_RUNNING_INSTANCES = "multi-instance";
88+
public const string ALTTESTER = "alttester";
8889

8990
public static class Multiplayer
9091
{

Explorer/Assets/DCL/Infrastructure/Global/Dynamic/MainSceneLoader.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public class MainSceneLoader : MonoBehaviour, ICoroutineRunner
8787
[SerializeField] private WorldInfoTool worldInfoTool = null!;
8888
[SerializeField] private AssetReferenceGameObject untrustedRealmConfirmationPrefab = null!;
8989
[SerializeField] private AssetReferenceGameObject singleInstanceRunningPopupPrefab = null!;
90+
[SerializeField] private GameObject altTesterPrefab = null!;
9091

9192
private BootstrapContainer? bootstrapContainer;
9293
private StaticContainer? staticContainer;
@@ -163,6 +164,10 @@ private async UniTask InitializeFlowAsync(CancellationToken ct)
163164

164165
FeatureFlagsConfiguration.Initialize(new FeatureFlagsConfiguration(FeatureFlagsResultDto.Empty));
165166

167+
// Alttester Automation (only works when ALTTESTER define is set)
168+
if (applicationParametersParser.HasFlag(AppArgsFlags.ALTTESTER))
169+
await InstantiateAsync(altTesterPrefab);
170+
166171
DCLVersion dclVersion = DCLVersion.FromAppArgs(applicationParametersParser);
167172
DiagnosticInfoUtils.LogSystem(dclVersion.Version);
168173

0 commit comments

Comments
 (0)