Switch initializr JavaScript build to local ParparVM target #2532
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: Test iOS native test scripts | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/scripts-ios-native.yml' | |
| - '.github/workflows/_build-ios-port.yml' | |
| - 'scripts/setup-workspace.sh' | |
| - 'scripts/build-ios-port.sh' | |
| - 'scripts/build-ios-app.sh' | |
| - 'scripts/run-ios-native-tests.sh' | |
| - 'scripts/ios/create-shared-scheme.py' | |
| - 'scripts/ios/notification-tests/native-tests/**' | |
| - 'scripts/ios/notification-tests/install-native-notification-tests.sh' | |
| - 'scripts/ios/notification-tests/**' | |
| - 'scripts/hellocodenameone/**' | |
| - 'scripts/templates/**' | |
| - '!scripts/templates/**/*.md' | |
| - 'CodenameOne/src/**' | |
| - '!CodenameOne/src/**/*.md' | |
| - 'Ports/iOSPort/**' | |
| - '!Ports/iOSPort/**/*.md' | |
| - 'native-themes/ios-modern/**' | |
| - '!native-themes/ios-modern/**/*.md' | |
| - 'vm/**' | |
| - '!vm/**/*.md' | |
| - 'tests/**' | |
| - '!tests/**/*.md' | |
| - '!docs/**' | |
| - 'maven/**' | |
| - '!maven/core-unittests/**' | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - '.github/workflows/scripts-ios-native.yml' | |
| - '.github/workflows/_build-ios-port.yml' | |
| - 'scripts/setup-workspace.sh' | |
| - 'scripts/build-ios-port.sh' | |
| - 'scripts/build-ios-app.sh' | |
| - 'scripts/run-ios-native-tests.sh' | |
| - 'scripts/ios/create-shared-scheme.py' | |
| - 'scripts/ios/notification-tests/native-tests/**' | |
| - 'scripts/ios/notification-tests/install-native-notification-tests.sh' | |
| - 'scripts/ios/notification-tests/**' | |
| - 'scripts/hellocodenameone/**' | |
| - 'scripts/templates/**' | |
| - '!scripts/templates/**/*.md' | |
| - 'CodenameOne/src/**' | |
| - '!CodenameOne/src/**/*.md' | |
| - 'Ports/iOSPort/**' | |
| - '!Ports/iOSPort/**/*.md' | |
| - 'native-themes/ios-modern/**' | |
| - '!native-themes/ios-modern/**/*.md' | |
| - 'vm/**' | |
| - '!vm/**/*.md' | |
| - 'tests/**' | |
| - '!tests/**/*.md' | |
| - '!docs/**' | |
| - 'maven/**' | |
| - '!maven/core-unittests/**' | |
| jobs: | |
| build-port: | |
| uses: ./.github/workflows/_build-ios-port.yml | |
| native-ios: | |
| needs: build-port | |
| permissions: | |
| contents: read | |
| runs-on: macos-15 | |
| timeout-minutes: 45 | |
| concurrency: | |
| group: mac-ci-${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Cache CocoaPods and user gems | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.gem | |
| ~/Library/Caches/CocoaPods | |
| ~/.cocoapods/repos | |
| key: ${{ runner.os }}-pods-v1-${{ hashFiles('scripts/setup-workspace.sh') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods-v1- | |
| - name: Ensure CocoaPods tooling | |
| run: | | |
| mkdir -p ~/.codenameone | |
| cp maven/UpdateCodenameOne.jar ~/.codenameone/ | |
| set -euo pipefail | |
| if ! command -v ruby >/dev/null; then | |
| echo "ruby not found"; exit 1 | |
| fi | |
| GEM_USER_DIR="$(ruby -e 'print Gem.user_dir')" | |
| export PATH="$GEM_USER_DIR/bin:$PATH" | |
| if ! command -v pod >/dev/null 2>&1; then | |
| gem install cocoapods xcodeproj --no-document --user-install | |
| fi | |
| pod --version | |
| - name: Compute setup-workspace hash | |
| id: setup_hash | |
| run: | | |
| set -euo pipefail | |
| echo "hash=$(shasum -a 256 scripts/setup-workspace.sh | awk '{print $1}')" >> "$GITHUB_OUTPUT" | |
| - name: Compute CN1 source hash | |
| id: src_hash | |
| run: | | |
| set -euo pipefail | |
| SRC_HASH=$(find CodenameOne/src Ports/iOSPort vm/JavaAPI vm/ByteCodeTranslator Themes native-themes \ | |
| maven/codenameone-maven-plugin/src/main \ | |
| -type f \( -name '*.java' -o -name '*.m' -o -name '*.h' -o -name '*.xml' -o -name '*.properties' -o -name '*.css' \) 2>/dev/null \ | |
| | sort | xargs shasum -a 256 | shasum -a 256 | awk '{print $1}') | |
| POM_HASH=$(find . -name 'pom.xml' -not -path './scripts/*' 2>/dev/null \ | |
| | sort | xargs shasum -a 256 | shasum -a 256 | awk '{print $1}') | |
| SCRIPT_HASH=$(shasum -a 256 \ | |
| scripts/setup-workspace.sh \ | |
| scripts/build-ios-port.sh \ | |
| scripts/build-native-themes.sh \ | |
| .github/workflows/_build-ios-port.yml \ | |
| | shasum -a 256 | awk '{print $1}') | |
| echo "hash=${SRC_HASH:0:16}-${POM_HASH:0:16}-${SCRIPT_HASH:0:16}" >> "$GITHUB_OUTPUT" | |
| - name: Set TMPDIR | |
| run: echo "TMPDIR=${{ runner.temp }}" >> $GITHUB_ENV | |
| - name: Cache codenameone-tools | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ runner.temp }}/codenameone-tools | |
| key: ${{ runner.os }}-cn1-tools-${{ steps.setup_hash.outputs.hash }} | |
| restore-keys: | | |
| ${{ runner.os }}-cn1-tools- | |
| - name: Cache Maven repository | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-m2- | |
| - name: Restore cn1-binaries cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ../cn1-binaries | |
| key: cn1-binaries-${{ runner.os }}-${{ steps.setup_hash.outputs.hash }} | |
| restore-keys: | | |
| cn1-binaries-${{ runner.os }}- | |
| - name: Restore built CN1 + iOS port artifacts | |
| # Use the exact key build-port saved against (published as a job | |
| # output). Recomputing src_hash locally drifts whenever new | |
| # source paths are added to the build-port hash without | |
| # mirroring the change here. | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ~/.m2/repository/com/codenameone | |
| Themes | |
| Ports/iOSPort/nativeSources | |
| key: ${{ needs.build-port.outputs.cn1_built_cache_key }} | |
| fail-on-cache-miss: true | |
| - name: Build sample iOS app | |
| id: build_ios_app | |
| run: ./scripts/build-ios-app.sh -q -DskipTests | |
| timeout-minutes: 30 | |
| - name: Run native iOS notification tests (XCTest) | |
| env: | |
| ARTIFACTS_DIR: ${{ github.workspace }}/artifacts/native-ios-tests | |
| run: | | |
| set -euo pipefail | |
| mkdir -p "${ARTIFACTS_DIR}" | |
| ./scripts/run-ios-native-tests.sh \ | |
| "${{ steps.build_ios_app.outputs.workspace }}" \ | |
| "${{ steps.build_ios_app.outputs.scheme }}" | |
| timeout-minutes: 25 | |
| - name: Upload native iOS artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ios-native-tests | |
| path: artifacts | |
| if-no-files-found: warn | |
| retention-days: 14 |