Repository navigation
docs: CLAUDE.md names the iOS reload gate, the Swift package that tes… #21
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| # The demo's build step asks no API: these builds are never shipped. | |
| HOTCODEPUSH_OFFLINE: '1' | |
| JAVA_VERSION: 21 | |
| # The native code compiles inside an app: the platform jobs install the package from this commit into the demo at | |
| # the commit the baseline names and build it. Debug builds, which bundle no JavaScript and so create no binary. | |
| jobs: | |
| javascript: | |
| name: Lint, typecheck, test and build the JavaScript | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| - run: npx eslint . && npx prettier --check . | |
| - run: npm run typecheck | |
| - run: npm test | |
| - run: npm run build | |
| android: | |
| name: Build the Android library inside the demo | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| path: package | |
| - name: Read the pinned demo commit | |
| id: baseline | |
| run: echo "demo=$(node -p "require('./package/benchmarks/baseline.json').demo.commit")" >> "$GITHUB_OUTPUT" | |
| - uses: actions/checkout@v7 | |
| with: | |
| repository: hotcodepush-team/react-native-code-push-demo | |
| ref: ${{ steps.baseline.outputs.demo }} | |
| path: demo | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: package/.nvmrc | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - uses: gradle/actions/setup-gradle@v5 | |
| - name: Pack the package from this commit | |
| working-directory: package | |
| run: npm ci && npm run build && npm pack --pack-destination "$RUNNER_TEMP" | |
| - name: Prepare the demo with the package | |
| run: node package/benchmarks/prepare-demo.mjs demo "$RUNNER_TEMP/with" with "$(ls "$RUNNER_TEMP"/hotcodepush-react-native-code-push-*.tgz)" | |
| - run: ./gradlew assembleDebug --console=plain | |
| working-directory: ${{ runner.temp }}/with/android | |
| ios: | |
| name: Build the iOS module inside the demo | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| path: package | |
| - name: Read the pinned demo commit | |
| id: baseline | |
| run: echo "demo=$(node -p "require('./package/benchmarks/baseline.json').demo.commit")" >> "$GITHUB_OUTPUT" | |
| - uses: actions/checkout@v7 | |
| with: | |
| repository: hotcodepush-team/react-native-code-push-demo | |
| ref: ${{ steps.baseline.outputs.demo }} | |
| path: demo | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: package/.nvmrc | |
| - run: brew install swiftlint | |
| - run: swiftlint lint --quiet --strict ios Tests | |
| working-directory: package | |
| - run: swift test | |
| working-directory: package | |
| - name: Pack the package from this commit | |
| working-directory: package | |
| run: npm ci && npm run build && npm pack --pack-destination "$RUNNER_TEMP" | |
| - name: Prepare the demo with the package | |
| run: node package/benchmarks/prepare-demo.mjs demo "$RUNNER_TEMP/with" with "$(ls "$RUNNER_TEMP"/hotcodepush-react-native-code-push-*.tgz)" | |
| - run: xcodebuild -workspace HotCodePushDemo.xcworkspace -scheme HotCodePushDemo -configuration Debug -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO -quiet build | |
| working-directory: ${{ runner.temp }}/with/ios | |
| preview: | |
| name: Publish the preview build to pkg.pr.new | |
| runs-on: ubuntu-latest | |
| needs: [javascript] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build | |
| - run: npx pkg-pr-new publish --commentWithSha |