diff --git a/.github/workflows/native-e2e.yml b/.github/workflows/native-e2e.yml new file mode 100644 index 00000000..4c65845b --- /dev/null +++ b/.github/workflows/native-e2e.yml @@ -0,0 +1,72 @@ +name: Native Simulator Tests + +on: + workflow_dispatch: + schedule: + - cron: '0 18 * * 0' # Monday 03:00 JST + +permissions: + contents: read + +concurrency: + group: native-e2e-${{ github.ref }} + cancel-in-progress: false + +jobs: + suite: + timeout-minutes: 75 + runs-on: xcode-27 + strategy: + fail-fast: false + matrix: + include: + - suite: ui-shell + script: scripts/verify-native-ui-shell.sh + scenario: '' + kana: '' + - suite: search + script: scripts/verify-native-search.sh + scenario: search + kana: kana + - suite: edge + script: scripts/verify-native-search.sh + scenario: edge + kana: '' + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v5 + with: + node-version: 24 + cache: npm + + - name: Record runner metadata + run: xcodebuild -version + + - name: Install XcodeGen + run: brew list xcodegen >/dev/null 2>&1 || brew install xcodegen + + - run: npm ci + - run: npm ci + working-directory: demo + + - name: Fetch pinned simulator setup + run: | + sha=$(jq -r '.packages["node_modules/@rdlabo/ionic-theme-utils"].resolved' package-lock.json | sed 's/.*#//') + curl -fsSL "https://raw.githubusercontent.com/rdlabo-dev/ionic-theme-utils/$sha/scripts/ci-simulator.sh" -o "$RUNNER_TEMP/ci-simulator.sh" + + - name: Create and boot simulator + run: sh "$RUNNER_TEMP/ci-simulator.sh" "iPhone 17" "iOS 27.0" ${{ matrix.kana }} + + - name: Run ${{ matrix.suite }} suite + run: sh ${{ matrix.script }} "$SIM_UDID" ${{ matrix.scenario }} + env: + VERIFY_ARTIFACTS_DIR: ${{ runner.temp }}/native-${{ matrix.suite }} + + - name: Upload diagnostics + if: always() + uses: actions/upload-artifact@v5 + with: + name: native-${{ matrix.suite }}-${{ github.run_id }} + path: ${{ runner.temp }}/native-${{ matrix.suite }} + if-no-files-found: warn + retention-days: 7 diff --git a/scripts/verify-native-search.sh b/scripts/verify-native-search.sh index 5292b7d2..5517d801 100644 --- a/scripts/verify-native-search.sh +++ b/scripts/verify-native-search.sh @@ -10,7 +10,12 @@ case "$scenario" in esac repo=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd) fixture="$repo/demo/native-$scenario-fixture" -artifacts=$(mktemp -d "/tmp/ionic-native-$scenario-verification.XXXXXX") +if [ "${VERIFY_ARTIFACTS_DIR:-}" ]; then + artifacts=$VERIFY_ARTIFACTS_DIR + mkdir -p "$artifacts" +else + artifacts=$(mktemp -d "/tmp/ionic-native-$scenario-verification.XXXXXX") +fi printf 'Native %s verification artifacts: %s\n' "$scenario" "$artifacts" cd "$repo" npm run build diff --git a/scripts/verify-native-ui-shell.sh b/scripts/verify-native-ui-shell.sh index b3f0d231..75978c56 100644 --- a/scripts/verify-native-ui-shell.sh +++ b/scripts/verify-native-ui-shell.sh @@ -6,7 +6,12 @@ set -eu simulator=${1:?Usage: sh scripts/verify-native-ui-shell.sh SIMULATOR_UDID} repo=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd) -artifacts=$(mktemp -d /tmp/ionic-native-ui-shell-verification.XXXXXX) +if [ "${VERIFY_ARTIFACTS_DIR:-}" ]; then + artifacts=$VERIFY_ARTIFACTS_DIR + mkdir -p "$artifacts" +else + artifacts=$(mktemp -d /tmp/ionic-native-ui-shell-verification.XXXXXX) +fi printf 'Native UI Shell verification artifacts: %s\n' "$artifacts" cd "$repo"