Skip to content

Commit

Permalink
Add checks to the Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jsubloom committed Sep 1, 2023
1 parent 4ff06b9 commit 2054ef0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/build-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
echo "Size of yarn.lock: $yarn_lock_size bytes"
working-directory: packages/web/

# TODO: Doesn't web need to run in the same job as iOS? It modifies src/autogenerated
# Well, or you need to be smarter about how autogenerated gets pulled in.
- name: 2) [web] Build
run: yarn build
working-directory: packages/web/
Expand Down Expand Up @@ -127,13 +129,32 @@ jobs:
# run: yarn --frozen-lockfile # TODO: --frozen-lockfile is erroring out, saying it must be updated. But it doesn't do that on my local machine. Why does it do that on the Github runner? Both seem to be using the same yarn version, 1.22.19
run: yarn

- name: 3) [${{ matrix.platform }}] Check for compile errors
run: yarn tsc

- name: 3) [${{ matrix.platform }}] Check if webapp was copied
id: check-webapp-copied
run: |
if [ -f "assets/web-dist/index.html" ] || [ -e "assets/web-dist/index.html" ]; then
echo "File exists"
echo "::set-output name=file_exists::true"
else
echo "File does not exist"
echo "::set-output name=file_exists::false"
fi
- name: 3) [${{ matrix.platform }}] Fail if webapp didn't get copied
if: steps.check-webapp-copied.outputs.file_exists != 'true'
run: |
echo "The file does not exist at assets/web-dist/index.html"
exit 1
- name: 3) [${{ matrix.platform }}] Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}

# Inspired by: https://github.com/suiet/suiet/blob/63b50e4ba225b294af1018f3f98b9666738837c7/.github/workflows/build-app.yml#L9
- name: 3) [${{ matrix.platform }}] EAS Local Build
run: eas build --local --platform ${{ matrix.platform }} --profile ${{ inputs.releaseChannel }} --non-interactive

Expand Down
6 changes: 6 additions & 0 deletions packages/mobile/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ AppBar needs some padding - amount TBD

Android builds fail in beta and release - Looks like https://github.com/expo/expo/issues/23265. Does this workaround work? https://github.com/expo/expo/issues/23265#issuecomment-1662709655
Well, or if you just publish the packages to the NPM repository, that would solve it for the release case. For local builds, you can continue using yarn link, and we have a viable workaround in local development and alpha mode.

In the interest of being able to maintain a future where [mobile] references [web] via a package number...
I suppose that when [web] builds, it should just copy its files into its dist folder (or output or whatever you want to name it).
[mobile] should have a postinstall script that looks in its node_modules, finds the webapp and copies the relevant files into the right place.

Also, if you're even more ambitious, maybe [web] shouldn't generate autogenerated source directly, but rather like a JSON file or something. Or idk, but at least it'd make more sense for the consumers [mobile] and [electron] to take a larger responsibility for generating their autogenerated source.

0 comments on commit 2054ef0

Please sign in to comment.