-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple different things are happening here:
1. Checked-in pre-compiled engines replaced by the download logic.
Engine hash is stored in checked-in `.versions/engine` file and is
downloaded in `prepare` script. Pre-compiled engines are still part of
published npm package but they are no longer checked into the
repository. That also removes the need for LFS setup.
2. CI workflow for automated testing is setup
It is pretty much e2e test from prisma/prisma moved into this repository
instead. Build example app and runs simple integration test on both iOS
and Android emulator. It also fixes a bunch of linting failures present
in the repo.
3. CI workflow for automated updates of client, engines, and automated
publishing of the package.
Polls npm on cron, if the update found on either `prisma@dev` or
`prisma@latest`, pulls in the new version, does update on the separate
temporary branch and runs aforementioned test on it. If the test is
succsful, branch is merged back into main and new `@prisma/react-native`
package is published with an identical version and npm tag.
Close prisma/team-orm#1106
- Loading branch information
Sergey Tatarintsev
committed
Apr 30, 2024
1 parent
51c19a4
commit 38e6c64
Showing
46 changed files
with
1,171 additions
and
3,741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
*.pbxproj -text | ||
# specific for windows script files | ||
*.bat text eol=crlf | ||
QueryEngine.xcframework/ios-arm64/libquery_engine.a filter=lfs diff=lfs merge=lfs -text | ||
QueryEngine.xcframework/ios-arm64_x86_64-simulator/libquery_engine.a filter=lfs diff=lfs merge=lfs -text | ||
*.bat text eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Check for a new client version | ||
on: | ||
schedule: | ||
- cron: '*/5 * * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check-update: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
latest: ${{ steps.check-update.outputs.latest }} | ||
dev: ${{ steps.check-update.outputs.dev }} | ||
integration: ${{ steps.check-update.outputs.dev }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Check for updates | ||
id: check-update | ||
run: yarn check-updates | ||
|
||
# update-latest: | ||
# name: Update latest tag | ||
# needs: | ||
# - check-update | ||
# if: ${{ needs.check-update.outputs.latest != ''}} | ||
# uses: ./.github/workflows/update-and-publish.yml | ||
# secrets: inherit | ||
# with: | ||
# npmTag: latest | ||
# version: ${{ needs.check-update.outputs.latest }} | ||
|
||
update-dev: | ||
name: Update dev tag | ||
needs: | ||
- check-update | ||
if: ${{ needs.check-update.outputs.dev != ''}} | ||
uses: ./.github/workflows/update-and-publish.yml | ||
secrets: inherit | ||
with: | ||
npmTag: dev | ||
version: ${{ needs.check-update.outputs.dev }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: Test | ||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: Ref to run the tests on | ||
type: string | ||
required: false | ||
|
||
jobs: | ||
lint-test: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Lint files | ||
run: yarn lint | ||
|
||
- name: Typecheck files | ||
run: yarn typecheck | ||
|
||
test-ios: | ||
name: E2E test for iOS | ||
runs-on: macos-14 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Install macOS dependencies | ||
run: | | ||
brew tap wix/brew | ||
brew install applesimutils | ||
env: | ||
HOMEBREW_NO_AUTO_UPDATE: 1 | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
- name: Install CocoaPods dependecies | ||
working-directory: example | ||
run: yarn pod-install | ||
|
||
- name: Detox build | ||
working-directory: example | ||
run: yarn detox build --configuration ios.sim.release | ||
|
||
- name: Detox test | ||
working-directory: example | ||
run: yarn detox test --configuration ios.sim.release --cleanup --headless | ||
|
||
test-android: | ||
name: E2E test for Android | ||
runs-on: ubuntu-latest | ||
steps: | ||
# default runner has not enough space for creating emulators | ||
- name: Free disk space | ||
uses: jlumbroso/[email protected] | ||
with: | ||
android: false | ||
tool-cache: true | ||
dotnet: true | ||
haskell: true | ||
swap-storage: true | ||
docker-images: true | ||
large-packages: false | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
cache: gradle | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Setup | ||
uses: ./.github/actions/setup | ||
|
||
- name: Detox build | ||
working-directory: example | ||
run: yarn detox build --configuration android.emu.release | ||
|
||
- name: Enable KVM group perms # make android simulator use KVM and run much faster | ||
run: | | ||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
sudo udevadm control --reload-rules | ||
sudo udevadm trigger --name-match=kvm | ||
- name: Detox test | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
working-directory: example | ||
api-level: 28 | ||
arch: x86_64 | ||
avd-name: Pixel_API_28 | ||
script: yarn detox test --configuration android.emu.release --headless |
Oops, something went wrong.