Skip to content

chore(deps-dev): bump eslint from 9.39.2 to 10.2.1 #487

chore(deps-dev): bump eslint from 9.39.2 to 10.2.1

chore(deps-dev): bump eslint from 9.39.2 to 10.2.1 #487

Workflow file for this run

name: Packages CI - Build, E2E, PM Tests
on:
push:
branches: [next]
paths:
- 'src/**'
- '.github/workflows/**'
- '.github/actions/**'
- 'scripts/**'
- 'package.json'
- 'bun.lock'
- 'assets/template/**'
pull_request:
branches: [main, next]
paths:
- 'src/**'
- '.github/workflows/**'
- '.github/actions/**'
- 'scripts/**'
- 'package.json'
- 'bun.lock'
- 'assets/template/**'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: write
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-build:
name: Lint and Build CLI
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- name: Setup Bun.js
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache bun dependencies
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
run: bun install
- name: Lint Code
run: bun lint
- name: Build CLI
run: bun run build
- name: Test CLI help commands
run: |
node lib/cli/index.js --help
node lib/cli/index.js create --help
define-matrix:
name: Define Package Matrices
runs-on: ubuntu-latest
outputs:
generation: ${{ steps.set-matrix.outputs.generation }}
ios-build: ${{ steps.set-matrix.outputs.ios_build }}
android-build: ${{ steps.set-matrix.outputs.android_build }}
ios-e2e: ${{ steps.set-matrix.outputs.ios_e2e }}
android-e2e: ${{ steps.set-matrix.outputs.android_e2e }}
steps:
- name: Build workflow matrices
id: set-matrix
shell: bash
run: |
node <<'NODE' >> "$GITHUB_OUTPUT"
const pms = ['bun', 'yarn']
const scenarios = [
{
package_type: 'module',
scenario: 'swift-kotlin',
platforms: 'ios,android',
langs: 'swift,kotlin',
runs_ios: true,
runs_android: true,
},
{
package_type: 'module',
scenario: 'cpp',
platforms: 'ios,android',
langs: 'c++',
runs_ios: true,
runs_android: true,
},
{
package_type: 'module',
scenario: 'swift-cpp',
platforms: 'ios,android',
langs: 'swift,c++',
runs_ios: true,
runs_android: true,
},
{
package_type: 'module',
scenario: 'cpp-kotlin',
platforms: 'ios,android',
langs: 'c++,kotlin',
runs_ios: true,
runs_android: true,
},
{
package_type: 'module',
scenario: 'swift',
platforms: 'ios',
langs: 'swift',
runs_ios: true,
runs_android: false,
},
{
package_type: 'module',
scenario: 'kotlin',
platforms: 'android',
langs: 'kotlin',
runs_ios: false,
runs_android: true,
},
{
package_type: 'module',
scenario: 'cpp-ios',
platforms: 'ios',
langs: 'c++',
runs_ios: true,
runs_android: false,
},
{
package_type: 'module',
scenario: 'cpp-android',
platforms: 'android',
langs: 'c++',
runs_ios: false,
runs_android: true,
},
{
package_type: 'view',
scenario: 'swift-kotlin',
platforms: 'ios,android',
langs: 'swift,kotlin',
runs_ios: true,
runs_android: true,
},
{
package_type: 'view',
scenario: 'swift',
platforms: 'ios',
langs: 'swift',
runs_ios: true,
runs_android: false,
},
{
package_type: 'view',
scenario: 'kotlin',
platforms: 'android',
langs: 'kotlin',
runs_ios: false,
runs_android: true,
},
]
const enrich = (item, extra = {}) => ({
...item,
...extra,
package_dir: `react-native-test-${item.package_type}-${item.scenario}`,
})
const generation = pms.flatMap(pm =>
scenarios.map(item => enrich(item, { pm }))
)
const iosBuild = pms.flatMap(pm =>
scenarios
.filter(item => item.runs_ios)
.flatMap(item =>
['Debug', 'Release'].map(mode =>
enrich(item, { pm, mode })
)
)
)
const androidBuild = pms.flatMap(pm =>
scenarios
.filter(item => item.runs_android)
.flatMap(item =>
['Debug', 'Release'].map(mode =>
enrich(item, { pm, mode })
)
)
)
const iosE2E = scenarios
.filter(item => item.runs_ios)
.map(item => enrich(item, { pm: 'bun', mode: 'Release' }))
const androidE2E = scenarios
.filter(item => item.runs_android)
.map(item => enrich(item, { pm: 'bun', mode: 'Release' }))
console.log(`generation=${JSON.stringify({ include: generation })}`)
console.log(`ios_build=${JSON.stringify({ include: iosBuild })}`)
console.log(`android_build=${JSON.stringify({ include: androidBuild })}`)
console.log(`ios_e2e=${JSON.stringify({ include: iosE2E })}`)
console.log(`android_e2e=${JSON.stringify({ include: androidE2E })}`)
NODE
generate-packages:
name: Generate ${{ matrix.package_type }} - ${{ matrix.scenario }} - ${{ matrix.pm }}
needs: [lint-and-build, define-matrix]
runs-on: macos-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.define-matrix.outputs.generation) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6
- name: Configure Git
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "actions@github.com"
- name: Setup Node.js
if: matrix.pm == 'yarn'
uses: actions/setup-node@v6
with:
node-version: 22.x
- name: Setup Bun.js
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache dependencies (bun)
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install repository dependencies
run: bun install
- name: Build CLI and Link Locally
run: |
bun run build
${{ matrix.pm }} link
- name: Generate package
run: |
${{ matrix.pm }} create nitro-module test-${{ matrix.package_type }}-${{ matrix.scenario }} \
--skip-install \
--ci \
--package-type ${{ matrix.package_type }} \
--platforms ${{ matrix.platforms }} \
--langs ${{ matrix.langs }}
- name: Verify generated package structure
shell: bash
run: |
PACKAGE_DIR="${{ matrix.package_dir }}"
if [ ! -d "$PACKAGE_DIR" ]; then
echo "Package directory not found: $PACKAGE_DIR"
ls -la
exit 1
fi
cd "$PACKAGE_DIR"
REQUIRED_PATHS=(
"package.json"
"README.md"
"src/"
"example/"
)
if [ "${{ matrix.runs_android }}" = "true" ]; then
REQUIRED_PATHS+=("android/")
fi
if [ "${{ matrix.runs_ios }}" = "true" ]; then
REQUIRED_PATHS+=("ios/")
fi
for path in "${REQUIRED_PATHS[@]}"; do
if [ ! -e "$path" ]; then
echo "Missing required file/directory: $path"
ls -la
exit 1
fi
echo "Found: $path"
done
if [ "${{ matrix.runs_android }}" != "true" ] && [ -e "android" ]; then
echo "Unexpected android directory for scenario ${{ matrix.scenario }}"
exit 1
fi
if [ "${{ matrix.runs_ios }}" != "true" ] && [ -e "ios" ]; then
echo "Unexpected ios directory for scenario ${{ matrix.scenario }}"
exit 1
fi
if [ "${{ matrix.runs_ios }}" = "true" ] && ! find . -maxdepth 1 -name "*.podspec" | grep -q .; then
echo "Expected podspec for iOS-enabled scenario"
exit 1
fi
if [ "${{ matrix.runs_ios }}" != "true" ] && find . -maxdepth 1 -name "*.podspec" | grep -q .; then
echo "Unexpected podspec for Android-only scenario"
exit 1
fi
- name: Test package.json content
shell: bash
run: |
cd "${{ matrix.package_dir }}"
if ! grep -q "react-native-test-${{ matrix.package_type }}-${{ matrix.scenario }}" package.json; then
echo "Package name not correct in package.json"
cat package.json
exit 1
fi
if ! grep -q '"scripts"' package.json; then
echo "Scripts section missing from package.json"
exit 1
fi
echo "package.json structure validated"
- name: Upload generated package
uses: actions/upload-artifact@v7
with:
name: test-${{ matrix.package_type }}-${{ matrix.scenario }}-${{ matrix.pm }}
path: ${{ matrix.package_dir }}
include-hidden-files: true
if-no-files-found: error
retention-days: 7
test-ios-build:
name: Test iOS Build - ${{ matrix.pm }} - ${{ matrix.package_type }} - ${{ matrix.scenario }} (${{ matrix.mode }})
needs: [generate-packages, define-matrix]
runs-on: macOS-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.define-matrix.outputs.ios-build) }}
env:
WORKING_DIR: ${{ github.workspace }}/${{ matrix.package_dir }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Create working directory
run: mkdir -p ${{ env.WORKING_DIR }}
- name: Download generated package
uses: actions/download-artifact@v8
with:
name: test-${{ matrix.package_type }}-${{ matrix.scenario }}-${{ matrix.pm }}
path: ${{ env.WORKING_DIR }}
- name: List package structure
working-directory: ${{ env.WORKING_DIR }}
run: |
echo "Package structure:"
find . -type f -name "*.json" -o -name "*.js" -o -name "*.ts" | head -20
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.4
- name: Setup Ruby and CocoaPods
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Setup Node.js
if: matrix.pm == 'yarn'
uses: actions/setup-node@v6
with:
node-version: 22.x
- name: Setup Yarn
if: matrix.pm == 'yarn'
uses: ./.github/actions/setup-yarn
with:
working-directory: ${{ env.WORKING_DIR }}
- name: Setup Bun.js
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install package dependencies
uses: ./.github/actions/install-deps
with:
pm: ${{ matrix.pm }}
working-directory: ${{ env.WORKING_DIR }}
- name: Run codegen and build
uses: ./.github/actions/run-codegen-build
with:
pm: ${{ matrix.pm }}
working-directory: ${{ env.WORKING_DIR }}
- name: Cache CocoaPods
uses: actions/cache@v5
with:
path: |
~/.cocoapods/repos
${{ env.WORKING_DIR }}/example/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles(format('{0}/example/ios/Podfile.lock', env.WORKING_DIR)) }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install CocoaPods dependencies
working-directory: ${{ env.WORKING_DIR }}/example
run: ${{ matrix.pm }} pod
- name: Build iOS project
uses: ./.github/actions/ios-build-xcode
with:
ios-dir: ${{ env.WORKING_DIR }}/example/ios
mode: ${{ matrix.mode }}
test-android-build:
name: Test Android Build - ${{ matrix.pm }} - ${{ matrix.package_type }} - ${{ matrix.scenario }} (${{ matrix.mode }})
needs: [generate-packages, define-matrix]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.define-matrix.outputs.android-build) }}
env:
WORKING_DIR: ${{ github.workspace }}/${{ matrix.package_dir }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Create working directory
run: mkdir -p ${{ env.WORKING_DIR }}
- name: Download generated package
uses: actions/download-artifact@v8
with:
name: test-${{ matrix.package_type }}-${{ matrix.scenario }}-${{ matrix.pm }}
path: ${{ env.WORKING_DIR }}
- name: List package structure
working-directory: ${{ env.WORKING_DIR }}
run: |
echo "Package structure:"
find . -type f -name "*.json" -o -name "*.js" -o -name "*.ts" | head -20
- name: Setup Node.js
if: matrix.pm == 'yarn'
uses: actions/setup-node@v6
with:
node-version: 22.x
- name: Setup Yarn
if: matrix.pm == 'yarn'
uses: ./.github/actions/setup-yarn
with:
working-directory: ${{ env.WORKING_DIR }}
- name: Setup Bun.js
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install package dependencies
uses: ./.github/actions/install-deps
with:
pm: ${{ matrix.pm }}
working-directory: ${{ env.WORKING_DIR }}
- name: Run codegen and build
uses: ./.github/actions/run-codegen-build
with:
pm: ${{ matrix.pm }}
working-directory: ${{ env.WORKING_DIR }}
- name: Setup Java for Android builds
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Cache Gradle
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles(format('{0}/example/android/**/*.gradle*', env.WORKING_DIR)) }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build Android project
uses: ./.github/actions/android-gradle-build
with:
android-dir: ${{ env.WORKING_DIR }}/example/android
mode: ${{ matrix.mode }}
e2e-android:
name: Android E2E - ${{ matrix.package_type }} - ${{ matrix.scenario }}
needs: [test-android-build, define-matrix]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.define-matrix.outputs.android-e2e) }}
env:
WORKING_DIR: ${{ github.workspace }}/${{ matrix.package_dir }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Enable KVM (Android emulator)
if: runner.os == 'Linux'
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: Create working directory
run: mkdir -p ${{ env.WORKING_DIR }}
- name: Download generated package
uses: actions/download-artifact@v8
with:
name: test-${{ matrix.package_type }}-${{ matrix.scenario }}-${{ matrix.pm }}
path: ${{ env.WORKING_DIR }}
- name: List package structure
working-directory: ${{ env.WORKING_DIR }}
run: find . -type f | head -30
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache Bun dependencies
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
uses: ./.github/actions/install-deps
with:
pm: ${{ matrix.pm }}
working-directory: ${{ env.WORKING_DIR }}
- name: Run codegen and build
uses: ./.github/actions/run-codegen-build
with:
pm: ${{ matrix.pm }}
working-directory: ${{ env.WORKING_DIR }}
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Setup Android SDK
uses: android-actions/setup-android@v4
- name: Install Maestro CLI
uses: ./.github/actions/setup-maestro
- name: Run Android Emulator and E2E Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 35
target: google_apis
arch: x86_64
profile: Galaxy Nexus
emulator-options: -no-snapshot -memory 4096 -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done'
${{ matrix.pm }} android:e2e ${{ env.WORKING_DIR }}/example ${{ matrix.package_type }}
e2e-ios:
name: iOS E2E - ${{ matrix.package_type }} - ${{ matrix.scenario }}
needs: [test-ios-build, define-matrix]
runs-on: macOS-15
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.define-matrix.outputs.ios-e2e) }}
env:
MAESTRO_DRIVER_STARTUP_TIMEOUT: 300_000
MAESTRO_CLI_ANALYSIS_NOTIFICATION_DISABLED: true
WORKING_DIR: ${{ github.workspace }}/${{ matrix.package_dir }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 16.4
- name: Create working directory
run: mkdir -p ${{ env.WORKING_DIR }}
- name: Download generated module
uses: actions/download-artifact@v8
with:
name: test-${{ matrix.package_type }}-${{ matrix.scenario }}-${{ matrix.pm }}
path: ${{ env.WORKING_DIR }}
- name: List package structure
working-directory: ${{ env.WORKING_DIR }}
run: find . -type f | head -30
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache Bun dependencies
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install Dependencies
uses: ./.github/actions/install-deps
with:
pm: ${{ matrix.pm }}
working-directory: ${{ env.WORKING_DIR }}
- name: Run codegen and build
uses: ./.github/actions/run-codegen-build
with:
pm: ${{ matrix.pm }}
working-directory: ${{ env.WORKING_DIR }}
- name: Cache Pods
uses: actions/cache@v5
with:
path: ${{ env.WORKING_DIR }}/example/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Run pod install
working-directory: ${{ env.WORKING_DIR }}/example/ios
run: pod install
- name: Setup ccache
run: |
brew install ccache
ccache --version
ccache --zero-stats
- name: Cache ccache
uses: actions/cache@v5
with:
path: ~/Library/Caches/ccache
key: ${{ runner.os }}-ccache-${{ matrix.package_type }}-${{ matrix.scenario }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-${{ matrix.package_type }}-${{ matrix.scenario }}-
${{ runner.os }}-ccache-
- name: Configure ccache
run: |
ccache --set-config=max_size=2G
ccache --set-config=compression=true
ccache --set-config=compression_level=6
- name: Install Maestro CLI
uses: ./.github/actions/setup-maestro
- name: Run tests
env:
USE_CCACHE: 1
CCACHE_DIR: ~/Library/Caches/ccache
run: ${{ matrix.pm }} ios:e2e ${{ env.WORKING_DIR }}/example ${{ matrix.package_type }}
- name: Print ccache statistics
if: always()
run: ccache --show-stats
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: maestro-artifacts-ios-${{ matrix.package_type }}-${{ matrix.scenario }}
path: e2e-artifacts
include-hidden-files: true