Skip to content

Conversation

@sjchmiela
Copy link
Contributor

@sjchmiela sjchmiela commented Jan 12, 2026

Why

The build-and-deploy-worker workflow had three separate jobs (setup, build-workers, deploy) with complex inter-job dependencies and redundant conditional logic. I think if we put it all in one job it should make stuff faster.

How

Consolidated all three jobs into a single build-and-deploy job with conditional steps:

  1. Check: Verify if tarballs for the current SHA exist in GCS (when deploying)
  2. Build: Execute EAS workflow if needed (PR testing or cache miss)
  3. Upload: Upload tarballs to GCS with SHA-based naming
  4. Deploy: Copy tarballs to environment-specific names (when deploying)

Key simplifications:

  • Assumption: Main branch always specifies an environment (staging/production), so environment == '' only occurs on PR builds
  • SHA-based caching: Check cache by SHA regardless of branch - if the code is identical (same SHA), reuse existing tarballs
  • Clearer conditions: Each step has a single clear purpose without overlapping branch-specific logic

I also added back building Linux tarball on Linux not to mix CPU architectures accidentally.

Test Plan

Build on PR. Deployment from a branch.

@github-actions
Copy link

github-actions bot commented Jan 12, 2026

Size Change: -884 B (0%)

Total Size: 53.3 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 53.3 MB -884 B (0%)

compressed-size-action

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.61%. Comparing base (03e1c18) to head (4a0a915).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3303   +/-   ##
=======================================
  Coverage   49.61%   49.61%           
=======================================
  Files         671      671           
  Lines       27979    27979           
  Branches     5788     5788           
=======================================
  Hits        13878    13878           
  Misses      12911    12911           
  Partials     1190     1190           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from stanley/simplify-worker-builds to main January 12, 2026 12:26
Merged the three separate jobs (setup, build-workers, deploy) into a
single build-and-deploy job with conditional steps:

- Setup: Check if tarballs exist in GCS (when environment specified)
- Build: Execute EAS workflow if needed (empty env or missing tarballs)
- Upload: Upload tarballs to GCS under SHA hash
- Deploy: Copy tarballs to environment-specific names (when env specified)

This simplification reduces job coordination complexity while maintaining
the same functionality and conditional execution logic.
When deploying from a custom branch with an environment specified,
always rebuild the worker tarballs instead of checking if they already
exist. This ensures testing actual branch changes rather than potentially
stale tarballs from main.

Only skip builds when deploying from main with existing cached tarballs,
which is safe since main is the source of truth.
With the assumption that main branch always specifies an environment:
- environment=='' only happens on PR builds
- Simplified all conditions to avoid redundant checks
- Build condition: not main OR (main but no cache)
- Upload condition: has environment AND (not main OR no cache)

The logic is now much easier to read and maintain while preserving
all the same behavior.
Simplified caching logic to always check if tarballs exist for the
current SHA, regardless of which branch we're on. Since tarballs are
stored by SHA, if they exist, the code is identical and we don't need
to rebuild.

This removes branch-specific logic and makes the workflow simpler:
- Check: Always check cache when deploying
- Build: Build if PR testing or cache miss
- Upload: Upload when deploying if we built
- Deploy: Deploy when environment specified
@sjchmiela sjchmiela force-pushed the claude/consolidate-ci-jobs-WvWYO branch from 9d361c5 to f331356 Compare January 12, 2026 12:28
Pass upload_artifact input to EAS workflow based on whether GHA will
upload tarballs to GCS. This avoids unnecessary artifact uploads for
PR builds where we build for testing but don't upload results.

- Set SHOULD_UPLOAD_ARTIFACT = environment set AND no cache
- Pass to EAS workflow via --input upload_artifact
- Skip artifact URL extraction when upload was disabled

This saves time and storage by only uploading artifacts when needed.
Split the EAS workflow into two jobs to ensure proper architecture:
- build_android_worker: Runs on ubuntu-medium (Linux x86_64)
- build_ios_worker: Runs on macos-medium (macOS ARM64)

This ensures Android tarballs are built on Linux x86_64 architecture
matching the GCP deployment VMs, avoiding potential native dependency
issues from cross-platform builds.

Both jobs respect the upload_artifact input to skip uploads when not
needed (e.g., PR builds).
@sjchmiela sjchmiela added the no changelog PR that doesn't require a changelog entry label Jan 12, 2026
@github-actions
Copy link

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@sjchmiela sjchmiela changed the title Merge setup, build, and deploy into single job [gha] Merge setup, build, and deploy into single job Jan 12, 2026
@sjchmiela sjchmiela marked this pull request as ready for review January 12, 2026 15:36
if: github.ref == 'refs/heads/main' || inputs.environment != ''
# Upload when deploying if we built something new
# Don't upload PR builds (no environment) or when using cached tarballs
if: inputs.environment != '' && steps.check_worker_exists.outputs.worker_exists == 'false'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do want to deploy from our branch to staging lets say we will just need to specify the environment correct? Same as before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Tested this here.

@sjchmiela sjchmiela merged commit c42b1a0 into main Jan 12, 2026
20 of 21 checks passed
@sjchmiela sjchmiela deleted the claude/consolidate-ci-jobs-WvWYO branch January 12, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants