-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from THEOplayer/feature/e2e_tests
Add e2e tests
- Loading branch information
Showing
103 changed files
with
21,066 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Build Android on PRs | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
api-level: [ 34 ] | ||
newArchEnabled: [ false ] | ||
name: Build for API Level ${{ matrix.api-level }} using ${{matrix.newArchEnabled == true && 'New' || 'Old' }} Architecture | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: adopt | ||
cache: gradle | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/actions/wrapper-validation@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
|
||
- name: Run npm install | ||
run: | | ||
npm i -g corepack | ||
npm ci --workspaces --include-workspace-root | ||
- name: Build workspaces | ||
run: npm run build | ||
|
||
- name: Run documentation tests | ||
run: npm test | ||
|
||
- name: Install & update e2e app with latest react-native-theoplayer | ||
run: | | ||
cd apps/e2e | ||
npm update react-native-theoplayer | ||
npm ci | ||
- name: Enable KVM | ||
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: Gradle cache | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: AVD cache | ||
uses: actions/cache@v4 | ||
id: avd-cache | ||
with: | ||
path: | | ||
~/.android/avd/* | ||
~/.android/adb* | ||
key: avd-${{ matrix.api-level }} | ||
|
||
- name: Create AVD and generate snapshot for caching | ||
if: steps.avd-cache.outputs.cache-hit != 'true' #check previous step output | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: google_apis | ||
arch: x86_64 | ||
cores: 2 | ||
ram-size: 3072M | ||
force-avd-creation: true | ||
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: true | ||
script: echo "Generated AVD snapshot for caching." | ||
|
||
- name: Modify gradle.properties for newArchEnabled | ||
working-directory: apps/e2e/android | ||
run: | | ||
# Modify or add the newArchEnabled property in gradle.properties | ||
echo "newArchEnabled=${{ matrix.newArchEnabled }}" >> ./gradle.properties | ||
cat ./gradle.properties | ||
- name: Run e2e tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: google_apis | ||
arch: x86_64 | ||
cores: 2 | ||
ram-size: 3072M | ||
force-avd-creation: true | ||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | ||
disable-animations: true | ||
script: | | ||
npm run test:e2e:android | ||
cat cavy_results.md >> $GITHUB_STEP_SUMMARY | ||
working-directory: apps/e2e |
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,88 @@ | ||
name: Build iOS on PRs | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
xcode_version: [ '15.4.0' ] | ||
newArchEnabled: [ 0 ] | ||
platform: [iOS, tvOS] | ||
name: Build for ${{ matrix.platform }} using XCode version ${{ matrix.xcode_version }} and ${{matrix.newArchEnabled == 1 && 'New' || 'Old' }} Architecture | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Select Xcode ${{ matrix.xcode_version }} | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: ${{ matrix.xcode_version }} | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
|
||
- name: Cache Ruby Gems | ||
uses: actions/cache@v4 | ||
with: | ||
path: vendor/bundle | ||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-gems- | ||
- name: Cache CocoaPods | ||
uses: actions/cache@v4 | ||
with: | ||
path: apps/e2e/ios/Pods | ||
key: pods-${{ runner.os }}-${{ hashFiles('Podfile.lock') }}-${{ matrix.newArchEnabled }} | ||
restore-keys: | | ||
pods-${{ runner.os }}- | ||
- name: Run npm install | ||
run: | | ||
npm i -g corepack | ||
npm ci --workspaces --include-workspace-root | ||
- name: Build workspaces | ||
run: npm run build | ||
|
||
- name: Run documentation tests | ||
run: npm test | ||
|
||
- name: Install & update e2e app with latest react-native-theoplayer | ||
run: | | ||
cd apps/e2e | ||
npm update react-native-theoplayer | ||
npm ci | ||
- name: Install Ruby dependencies | ||
working-directory: apps/e2e | ||
run: bundle install | ||
|
||
- name: Run pod install & update dependencies | ||
working-directory: apps/e2e/ios | ||
run: | | ||
RCT_NEW_ARCH_ENABLED=${{ matrix.newArchEnabled }} bundle exec pod install | ||
- name: Start iOS simulator | ||
uses: futureware-tech/simulator-action@v4 | ||
with: | ||
model: ${{ matrix.platform == 'iOS' && 'iPhone 15' || 'Apple TV' }} | ||
os: ${{ matrix.platform }} | ||
os_version: '>=14.0' | ||
|
||
- name: Run e2e tests | ||
working-directory: apps/e2e | ||
run: npm run test:e2e:${{ matrix.platform == 'iOS' && 'ios' || 'tvos' }} | ||
|
||
- name: Summarize results | ||
working-directory: apps/e2e | ||
if: always() | ||
run: cat cavy_results.md >> $GITHUB_STEP_SUMMARY |
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,4 +1,4 @@ | ||
name: Test | ||
name: Build Web on PRs | ||
on: | ||
push: | ||
branches: | ||
|
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,2 @@ | ||
BUNDLE_PATH: "vendor/bundle" | ||
BUNDLE_FORCE_RUBY_PLATFORM: 1 |
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 @@ | ||
2.7.5 |
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,5 @@ | ||
source "https://rubygems.org" | ||
|
||
# Cocoapods 1.15 introduced a bug which breaks the build. | ||
gem 'cocoapods', '>= 1.13', '< 1.15' | ||
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' |
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,55 @@ | ||
# To learn about Buck see [Docs](https://buckbuild.com/). | ||
# To run your application with Buck: | ||
# - install Buck | ||
# - `npm start` - to start the packager | ||
# - `cd android` | ||
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` | ||
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck | ||
# - `buck install -r android/app` - compile, install and run application | ||
# | ||
|
||
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") | ||
|
||
lib_deps = [] | ||
|
||
create_aar_targets(glob(["libs/*.aar"])) | ||
|
||
create_jar_targets(glob(["libs/*.jar"])) | ||
|
||
android_library( | ||
name = "all-libs", | ||
exported_deps = lib_deps, | ||
) | ||
|
||
android_library( | ||
name = "app-code", | ||
srcs = glob([ | ||
"src/main/java/**/*.java", | ||
]), | ||
deps = [ | ||
":all-libs", | ||
":build_config", | ||
":res", | ||
], | ||
) | ||
|
||
android_build_config( | ||
name = "build_config", | ||
package = "com.reactnativetheoplayer", | ||
) | ||
|
||
android_resource( | ||
name = "res", | ||
package = "com.reactnativetheoplayer", | ||
res = "src/main/res", | ||
) | ||
|
||
android_binary( | ||
name = "app", | ||
keystore = "//android/keystores:debug", | ||
manifest = "src/main/AndroidManifest.xml", | ||
package_type = "debug", | ||
deps = [ | ||
":app-code", | ||
], | ||
) |
Oops, something went wrong.