Moving initializr to new JS port #892
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 packaging | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/ios-packaging.yml' | |
| - '.github/workflows/_build-ios-port.yml' | |
| - 'maven/codenameone-maven-plugin/**' | |
| - 'vm/ByteCodeTranslator/**' | |
| - 'Ports/iOSPort/**' | |
| - 'scripts/build-ios-app.sh' | |
| - 'scripts/run-ios-ui-tests.sh' | |
| - 'scripts/run-ios-native-tests.sh' | |
| - 'scripts/ios/**' | |
| - 'scripts/hellocodenameone/**' | |
| - '!docs/**' | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - '.github/workflows/ios-packaging.yml' | |
| - '.github/workflows/_build-ios-port.yml' | |
| - 'maven/codenameone-maven-plugin/**' | |
| - 'vm/ByteCodeTranslator/**' | |
| - 'Ports/iOSPort/**' | |
| - 'scripts/build-ios-app.sh' | |
| - 'scripts/run-ios-ui-tests.sh' | |
| - 'scripts/run-ios-native-tests.sh' | |
| - 'scripts/ios/**' | |
| - 'scripts/hellocodenameone/**' | |
| - '!docs/**' | |
| jobs: | |
| build-port: | |
| uses: ./.github/workflows/_build-ios-port.yml | |
| packaging: | |
| needs: build-port | |
| permissions: | |
| contents: read | |
| runs-on: macos-15 | |
| timeout-minutes: 45 | |
| # Exercises both CocoaPods and SPM in a single Xcode project. Catches | |
| # regressions in either dependency manager (each pathway runs end to end) | |
| # and additionally validates that they coexist correctly. | |
| env: | |
| IOS_DEPENDENCY_ARGS: >- | |
| -Dcodename1.arg.ios.dependencyManager=both | |
| -Dcodename1.arg.ios.pods=AFNetworking | |
| -Dcodename1.arg.ios.spm.packages=swift-collections|https://github.com/apple/swift-collections.git|from:1.1.0 | |
| -Dcodename1.arg.ios.spm.products.swift-collections=Collections | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache CocoaPods and user gems | |
| uses: actions/cache@v4 | |
| 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 | |
| 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 \ | |
| -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@v4 | |
| 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@v4 | |
| with: | |
| path: ~/.m2/repository | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-m2- | |
| - name: Restore cn1-binaries cache | |
| uses: actions/cache@v4 | |
| 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 | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ~/.m2/repository/com/codenameone | |
| Themes | |
| Ports/iOSPort/nativeSources | |
| key: cn1-built-${{ runner.os }}-${{ steps.src_hash.outputs.hash }} | |
| 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 iOS UI smoke | |
| env: | |
| ARTIFACTS_DIR: ${{ github.workspace }}/artifacts/ios-packaging | |
| run: | | |
| set -euo pipefail | |
| mkdir -p "${ARTIFACTS_DIR}" | |
| ./scripts/run-ios-ui-tests.sh \ | |
| "${{ steps.build_ios_app.outputs.workspace }}" \ | |
| "" \ | |
| "${{ steps.build_ios_app.outputs.scheme }}" | |
| timeout-minutes: 30 | |
| - name: Run native iOS notification tests | |
| env: | |
| ARTIFACTS_DIR: ${{ github.workspace }}/artifacts/ios-packaging-native | |
| 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: 20 | |
| - name: Upload packaging artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-packaging | |
| path: artifacts | |
| if-no-files-found: warn | |
| retention-days: 14 |