Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Run local EAS build on GitHub Actions #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

karlhorky
Copy link
Contributor

Supersedes #2

Hi there, thanks for this example!

I just wanted to open this PR after having looked at @byCedric's eas-gh example.

This uses the new experimental local EAS builds, enabling fully local builds.

Caveat: this does make the build take longer.

If you would like to preserve the existing workflow, I could imagine this being added as a second example workflow.

@matthias-fi matthias-fi force-pushed the run-local-eas-build-on-github-actions branch from 6d59872 to 8f67dd6 Compare April 11, 2022 13:45
@matthias-fi
Copy link
Contributor

matthias-fi commented Apr 11, 2022

@karlhorky: Unfortunately, the local build is not working. I looked into it for a bit today but wasn't able to solve it yet.

This is the error message:

DetoxRuntimeError: field CFBundleIdentifier not found inside Info.plist of app binary at /Users/runner/work/eas-detox-ci/eas-detox-ci/bin/easdetoxci.app

-> The latest Actions run.

@karlhorky
Copy link
Contributor Author

karlhorky commented Apr 11, 2022

Ah right, yeah I was getting this too, that's what caused me to move away from EAS altogether and just run xcodebuild commands directly - you can kind of see the evolution of this in the PR here: upleveled/hotline-bling-codealong#21

But I did find out other incompatibilities with Detox and Expo / EAS in the meantime, one of which was this @config-plugins/detox thing (although Android is more often mentioned in the readme):

https://github.com/upleveled/hotline-bling-codealong/blob/8debae19b03829722b2442776ec78502a271f967/app.json#L35


On a different note, something you may also be interested in: I also got Android Detox tests set up using Gradle upleveled/hotline-bling-codealong#26

@matthias-fi
Copy link
Contributor

Thanks for the notes! 👍

I actually worked a bit on CI today and found a nice solution for fetching the latest build URL directly via the eas cli (see workflow here).

The main reason why we transitioned everything to Expo is to actually reduce the complexity of building a native app. So that's why I prefer eas over locally handling the build.

Next steps

  • I haven't looked into running Detox on Android with eas builds yet, but will be trying it out in the next few days probably.
  • For now, the e2e tests workflow assumes we always have a simulator build ready. We will need to create one from time to time though whenever native dependencies change. Should be easy to check though if the yarn.lock file has changed or not.

So to conclude, I think if you build your app with expo/eas, it should be possible to avoid setting up local build environments altogether. At least that's my goal for this repo here.

@karlhorky
Copy link
Contributor Author

The main reason why we transitioned everything to Expo is to actually reduce the complexity of building a native app. So that's why I prefer eas over locally handling the build.

Totally, this is why I tried getting EAS set up in the first place. But it didn't work with Android or iOS in my testing, so I abandoned it after a few hours. If you want to go forward with this, and also use it for Android, keep in mind that Android is more challenging, because Detox needs two .apk files (one normal app and one testing apk), which requires a special Gradle command which is not run by default on EAS (check the gradlew command that I run in my detox.config.js). Not even sure whether EAS supports this workflow at all, to be honest.

But if you get it working, then I will definitely transition to that too!

  • For now, the e2e tests workflow assumes we always have a simulator build ready. We will need to create one from time to time though whenever native dependencies change. Should be easy to check though if the yarn.lock file has changed or not.

Nice, yep, you should be able to automate this as well, just look at the md5 hashes of the current and last commit of the contents of yarn.lock - I've seen this in some other GitHub actions.

I actually worked a bit on CI today and found a nice solution for fetching the latest build URL directly via the eas cli (see workflow here).

Nice, that looks like a good start. You could probably simplify that a bit by not writing to a file and instead using sed or similar to get the URL directly in bash.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants