Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into ta/sc-251674/merging-paylo…
Browse files Browse the repository at this point in the history
…ad-filtering
  • Loading branch information
tanderson-ld committed Sep 9, 2024
2 parents e180de6 + fca4d92 commit 2eb9bd9
Show file tree
Hide file tree
Showing 179 changed files with 1,942 additions and 596 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: sdk/browser

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

jobs:
build-test-browser:
runs-on: ubuntu-latest

strategy:
matrix:
# Node versions to run on.
version: [18, 21]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
registry-url: 'https://registry.npmjs.org'
- id: shared
name: Shared CI Steps
uses: ./actions/ci
with:
workspace_name: '@launchdarkly/js-client-sdk'
workspace_path: packages/sdk/browser
1 change: 1 addition & 0 deletions .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
- packages/store/node-server-sdk-redis
- packages/store/node-server-sdk-dynamodb
- packages/telemetry/node-server-sdk-otel
- packages/sdk/browser
name: Publish Documentation
jobs:
build-publish:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ on:
- packages/store/node-server-sdk-dynamodb
- packages/telemetry/node-server-sdk-otel
- packages/tooling/jest
- packages/sdk/browser
prerelease:
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
type: boolean
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/react-native-detox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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/**'
- 'packages/shared/mocks/**'

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 2eb9bd9

Please sign in to comment.