Migrate example project and build tooling to Java 17; add compatibili… #1783
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 build scripts | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/scripts-ios.yml' | |
| - 'scripts/setup-workspace.sh' | |
| - 'scripts/build-ios-port.sh' | |
| - 'scripts/build-ios-app.sh' | |
| - 'scripts/run-ios-ui-tests.sh' | |
| - 'scripts/run-ios-native-tests.sh' | |
| - 'scripts/ios/notification-tests/native-tests/**' | |
| - 'scripts/ios/notification-tests/install-native-notification-tests.sh' | |
| - 'scripts/ios/notification-tests/**' | |
| - 'scripts/hellocodenameone/**' | |
| - 'scripts/ios/tests/**' | |
| - 'scripts/ios/screenshots/**' | |
| - 'scripts/templates/**' | |
| - '!scripts/templates/**/*.md' | |
| - 'CodenameOne/src/**' | |
| - '!CodenameOne/src/**/*.md' | |
| - 'Ports/iOSPort/**' | |
| - '!Ports/iOSPort/**/*.md' | |
| - 'vm/**' | |
| - '!vm/**/*.md' | |
| - 'tests/**' | |
| - '!tests/**/*.md' | |
| - '!docs/**' | |
| - 'maven/**' | |
| - '!maven/core-unittests/**' | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - '.github/workflows/scripts-ios.yml' | |
| - 'scripts/setup-workspace.sh' | |
| - 'scripts/build-ios-port.sh' | |
| - 'scripts/build-ios-app.sh' | |
| - 'scripts/run-ios-ui-tests.sh' | |
| - 'scripts/run-ios-native-tests.sh' | |
| - 'scripts/ios/notification-tests/native-tests/**' | |
| - 'scripts/ios/notification-tests/install-native-notification-tests.sh' | |
| - 'scripts/ios/notification-tests/**' | |
| - 'scripts/hellocodenameone/**' | |
| - 'scripts/ios/tests/**' | |
| - 'scripts/ios/screenshots/**' | |
| - 'scripts/templates/**' | |
| - '!scripts/templates/**/*.md' | |
| - 'CodenameOne/src/**' | |
| - '!CodenameOne/src/**/*.md' | |
| - 'Ports/iOSPort/**' | |
| - '!Ports/iOSPort/**/*.md' | |
| - 'vm/**' | |
| - '!vm/**/*.md' | |
| - 'tests/**' | |
| - '!tests/**/*.md' | |
| - '!docs/**' | |
| - 'maven/**' | |
| - '!maven/core-unittests/**' | |
| jobs: | |
| build-ios: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| runs-on: macos-15 # pinning macos-15 avoids surprises during the cutover window | |
| timeout-minutes: 60 # allow enough time for dependency installs and full build | |
| concurrency: # ensure only one mac build runs at once | |
| group: mac-ci-${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CN1SS_GH_TOKEN }} | |
| GH_TOKEN: ${{ secrets.CN1SS_GH_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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" | |
| gem install cocoapods xcodeproj --no-document --user-install | |
| 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: 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: 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 }}- | |
| # Temporary disabled due to github issue: https://github.com/actions/runner/issues/4134 | |
| # - name: Restore cn1-binaries cache | |
| # uses: actions/cache@v4 | |
| # with: | |
| # path: ../cn1-binaries | |
| # key: cn1-binaries-${{ runner.os }}-${{ hashFiles('scripts/setup-workspace.sh') }} | |
| # restore-keys: | | |
| # cn1-binaries-${{ runner.os }}- | |
| - name: Setup workspace | |
| run: ./scripts/setup-workspace.sh -q -DskipTests | |
| # per-step timeout | |
| timeout-minutes: 25 | |
| - name: Build iOS port | |
| run: ./scripts/build-ios-port.sh -q -DskipTests | |
| timeout-minutes: 25 | |
| - name: Build sample iOS app and compile workspace (UIScene on) | |
| id: build-ios-app-scene | |
| env: | |
| IOS_UISCENE: "true" | |
| run: ./scripts/build-ios-app.sh -q -DskipTests | |
| timeout-minutes: 30 | |
| - name: Run iOS UI screenshot tests (UIScene on) | |
| env: | |
| ARTIFACTS_DIR: ${{ github.workspace }}/artifacts/ios-ui-tests-scene-true | |
| run: | | |
| set -euo pipefail | |
| mkdir -p "${ARTIFACTS_DIR}" | |
| echo "workspace='${{ steps.build-ios-app-scene.outputs.workspace }}'" | |
| echo "scheme='${{ steps.build-ios-app-scene.outputs.scheme }}'" | |
| ./scripts/run-ios-ui-tests.sh \ | |
| "${{ steps.build-ios-app-scene.outputs.workspace }}" \ | |
| "" \ | |
| "${{ steps.build-ios-app-scene.outputs.scheme }}" | |
| timeout-minutes: 30 | |
| - name: Build sample iOS app and compile workspace (UIScene off) | |
| id: build-ios-app | |
| env: | |
| IOS_UISCENE: "false" | |
| run: ./scripts/build-ios-app.sh -q -DskipTests | |
| timeout-minutes: 30 | |
| - name: Run iOS UI screenshot tests (UIScene off) | |
| env: | |
| ARTIFACTS_DIR: ${{ github.workspace }}/artifacts/ios-ui-tests-scene-false | |
| run: | | |
| set -euo pipefail | |
| mkdir -p "${ARTIFACTS_DIR}" | |
| echo "workspace='${{ steps.build-ios-app.outputs.workspace }}'" | |
| echo "scheme='${{ steps.build-ios-app.outputs.scheme }}'" | |
| ./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 (XCTest) | |
| env: | |
| ARTIFACTS_DIR: ${{ github.workspace }}/artifacts | |
| 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 iOS artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-ui-tests | |
| path: artifacts | |
| if-no-files-found: warn | |
| retention-days: 14 |