Skip to content

Commit

Permalink
Merge branch 'dob/modelConfig' into feat/dob/REL-3130/aiExamples
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Nov 4, 2024
2 parents 9c4e69f + fcad822 commit 59d0c27
Show file tree
Hide file tree
Showing 442 changed files with 18,056 additions and 4,629 deletions.
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,38 @@ module.exports = {
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/valid-expect': 'error',
'no-underscore-dangle': ['error', { allowAfterThis: true }],
'@typescript-eslint/naming-convention': [
'error',
{
selector: ['method'],
format: ['camelCase'],
leadingUnderscore: 'forbid',
},
{
selector: ['method'],
format: ['camelCase'],
modifiers: ['private'],
leadingUnderscore: 'require',
},
{
selector: ['classProperty', 'parameterProperty'],
format: ['camelCase'],
leadingUnderscore: 'forbid',
},
{
selector: ['classProperty', 'parameterProperty'],
modifiers: ['static'],
format: ['PascalCase'],
leadingUnderscore: 'forbid',
},
{
selector: ['classProperty', 'parameterProperty'],
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'require',
},
],
},
globals: {
BigInt: 'readonly',
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:

jobs:
build-test-browser:
permissions:
pull-requests: write
runs-on: ubuntu-latest

strategy:
Expand All @@ -31,3 +33,12 @@ jobs:
with:
workspace_name: '@launchdarkly/js-client-sdk'
workspace_path: packages/sdk/browser
- name: Check package size
if: github.event_name == 'pull_request' && matrix.version == '21'
uses: ./actions/package-size
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
target_file: 'packages/sdk/browser/dist/index.js'
package_name: '@launchdarkly/js-client-sdk'
pr_number: ${{ github.event.number }}
size_limit: 21000
9 changes: 9 additions & 0 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,12 @@ jobs:
with:
workspace_name: '@launchdarkly/js-sdk-common'
workspace_path: packages/shared/common
- name: Check package size
if: github.event_name == 'pull_request'
uses: ./actions/package-size
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
target_file: 'packages/shared/common/dist/esm/index.mjs'
package_name: '@launchdarkly/js-sdk-common'
pr_number: ${{ github.event.number }}
size_limit: 21000
25 changes: 0 additions & 25 deletions .github/workflows/mocks.yml

This file was deleted.

94 changes: 94 additions & 0 deletions .github/workflows/react-native-detox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: sdk/react-native/example

# The example builds independently of react-native because of the duration of the build.
# We limit it to only build under specific circumstances.
# Additionally this does allow for scheduled builds of just the example, to handle changes in expo,
# should they be desired.

on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [main, 'feat/**']
paths:
- 'packages/shared/common/**'
- 'packages/shared/sdk-client/**'
- 'packages/sdk/react-native/**'

jobs:
detox-android:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
defaults:
run:
working-directory: packages/sdk/react-native/example
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4

- name: Install deps
run: yarn workspaces focus
- name: Build
run: yarn workspaces foreach -pR --topological-dev --from 'react-native-example' run build

- uses: ./actions/release-secrets
name: 'Get mobile key'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN_EXAMPLES }}
ssm_parameter_pairs: '/sdk/common/hello-apps/mobile-key = MOBILE_KEY,
/sdk/common/hello-apps/boolean-flag-key = LAUNCHDARKLY_FLAG_KEY'

- name: Create .env file.
run: echo "MOBILE_KEY=$MOBILE_KEY" > .env

- name: Enable KVM group perms (for performance)
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: Expo Prebuild
run: npx expo prebuild

# Java setup is after checkout and expo prebuild so that it can locate the
# gradle configuration.
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: 'gradle'

- name: Detox build
run: yarn detox build --configuration android.emu.release

- name: Get android emulator device name
id: device
run: node -e "console.log('AVD_NAME=' + require('./.detoxrc').devices.emulator.device.avdName)" >> $GITHUB_OUTPUT

- name: Make space for the emulator.
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
android: false # We need android.

- name: Detox test
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915
with:
api-level: 31
arch: x86_64
avd-name: ${{ steps.device.outputs.AVD_NAME }}
working-directory: packages/sdk/react-native/example
script: yarn detox test --configuration android.emu.release --headless --record-logs all

- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: detox-artifacts
path: packages/sdk/react-native/example/artifacts
62 changes: 0 additions & 62 deletions .github/workflows/react-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,65 +22,3 @@ jobs:
with:
workspace_name: '@launchdarkly/react-native-client-sdk'
workspace_path: packages/sdk/react-native
detox-ios:
# TODO: disable detox for now because it's unstable.
if: false
# macos-latest uses macos-12 and we need macos-14 to get xcode 15.
# https://github.com/actions/runner-images/blob/main/README.md
runs-on: macos-14
permissions:
id-token: write
contents: read
defaults:
run:
working-directory: packages/sdk/react-native/example
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Install deps
run: yarn workspaces focus
- name: Build
run: yarn workspaces foreach -pR --topological-dev --from 'react-native-example' run build
- name: Install macOS dependencies
run: |
brew tap wix/brew
brew install applesimutils
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1

- name: Cache Detox build
id: cache-detox-build
uses: actions/cache@v4
with:
path: ios/build
key: ${{ runner.os }}-detox-build
restore-keys: |
${{ runner.os }}-detox-build
- name: Detox rebuild framework cache
run: yarn detox rebuild-framework-cache

- uses: ./actions/release-secrets
name: 'Get mobile key'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/sdk/detox/mobile-key = MOBILE_KEY'

- name: Set mobile key
run: echo "MOBILE_KEY=$MOBILE_KEY" > .env

- name: Expo prebuild
# HACK: Deleting ios/.xcode.env.local is needed to solve an xcode build issue with rn 0.73
# https://github.com/facebook/react-native/issues/42112#issuecomment-1884536225
run: |
export NO_FLIPPER=1
yarn expo-prebuild
rm -rf ./ios/.xcode.env.local
- name: Detox build
run: yarn detox build --configuration ios.sim.release

- name: Detox test
run: yarn detox test --configuration ios.sim.release --cleanup --headless --record-logs all --take-screenshots failing
Loading

0 comments on commit 59d0c27

Please sign in to comment.