rn-agent-kit 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +291 -2
- package/dist/cli.js +2916 -0
- package/dist/cli.js.map +1 -0
- package/dist/scripts/figma-tokens.js +1284 -0
- package/dist/scripts/figma-tokens.js.map +1 -0
- package/dist/scripts/validate-jira-tickets.js +169 -0
- package/dist/scripts/validate-jira-tickets.js.map +1 -0
- package/package.json +66 -4
- package/skills/expo-cli/SKILL.md +213 -0
- package/skills/figma-to-tokens/SKILL.md +288 -0
- package/skills/github-actions-ci/SKILL.md +124 -0
- package/skills/maestro-e2e/SKILL.md +256 -0
- package/skills/prd-to-jira/SKILL.md +237 -0
- package/skills/rn-architecture/SKILL.md +207 -0
- package/skills/rn-native-android-ios/SKILL.md +195 -0
- package/skills/rn-sdk-integrations/SKILL.md +274 -0
- package/skills/rn-typescript-react/SKILL.md +247 -0
- package/skills/ticket-to-code/SKILL.md +192 -0
- package/templates/config/rn-agent-kit.json +4 -0
- package/templates/eslint/eslint.config.snippet.mjs +16 -0
- package/templates/eslint/rn-agent-kit-rules.cjs +137 -0
- package/templates/jira-ticket.md +78 -0
- package/templates/maestro/smoke.yaml +4 -0
- package/templates/scaffold/.husky/commit-msg +4 -0
- package/templates/scaffold/.husky/pre-commit +4 -0
- package/templates/scaffold/.prettierignore +6 -0
- package/templates/scaffold/.prettierrc +6 -0
- package/templates/scaffold/commitlint.config.cjs +4 -0
- package/templates/scaffold/eslint.config.js +22 -0
- package/templates/scaffold/jest.config.cjs +9 -0
- package/templates/scaffold/tsconfig.json +13 -0
- package/templates/workflows/ci.yml +120 -0
- package/templates/workflows/e2e-android.yml +158 -0
- package/templates/workflows/e2e-ios.yml +134 -0
- package/templates/workflows/eas-build.yml +94 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
|
|
5
|
+
export default tseslint.config(
|
|
6
|
+
eslint.configs.recommended,
|
|
7
|
+
...tseslint.configs.recommended,
|
|
8
|
+
eslintConfigPrettier,
|
|
9
|
+
{
|
|
10
|
+
ignores: ["node_modules/**", "dist/**", "android/**", "ios/**", ".expo/**"],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
files: ["**/*.{ts,tsx,js,jsx}"],
|
|
14
|
+
rules: {
|
|
15
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
16
|
+
"@typescript-eslint/no-unused-vars": [
|
|
17
|
+
"error",
|
|
18
|
+
{ argsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @type {import('jest').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
preset: "react-native",
|
|
4
|
+
moduleNameMapper: {
|
|
5
|
+
"^@/(.*)$": "<rootDir>/src/$1",
|
|
6
|
+
},
|
|
7
|
+
setupFilesAfterEnv: ["@testing-library/react-native/extend-expect"],
|
|
8
|
+
testPathIgnorePatterns: ["/node_modules/", "/android/", "/ios/"],
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "expo/tsconfig.base",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"strict": true,
|
|
5
|
+
"baseUrl": ".",
|
|
6
|
+
"paths": {
|
|
7
|
+
"@/*": ["./src/*"],
|
|
8
|
+
"@/features/*": ["./src/features/*"],
|
|
9
|
+
"@/shared/*": ["./src/shared/*"]
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Static checks on every pull request: types, lint, unit tests, design-token drift.
|
|
2
|
+
name: CI
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
pull_request:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
pull-requests: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
quality:
|
|
19
|
+
name: quality
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
timeout-minutes: 25
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@v4.2.2
|
|
25
|
+
|
|
26
|
+
- name: Setup Node
|
|
27
|
+
uses: actions/setup-node@v4.2.0
|
|
28
|
+
with:
|
|
29
|
+
node-version: "20"
|
|
30
|
+
cache: npm
|
|
31
|
+
|
|
32
|
+
- name: Install
|
|
33
|
+
run: npm ci
|
|
34
|
+
|
|
35
|
+
- name: Typecheck
|
|
36
|
+
run: npx tsc --noEmit
|
|
37
|
+
|
|
38
|
+
- name: ESLint
|
|
39
|
+
run: npm run lint
|
|
40
|
+
|
|
41
|
+
- name: Jest (coverage)
|
|
42
|
+
run: npm test -- --coverage --coverageReporters=text-summary --coverageReporters=lcov --coverageReporters=json-summary
|
|
43
|
+
|
|
44
|
+
- name: Design tokens up to date
|
|
45
|
+
# Re-validates generated theme vs tokens.json vs source-snapshot (fail on drift).
|
|
46
|
+
run: |
|
|
47
|
+
if [ -f design/source-snapshot.json ]; then
|
|
48
|
+
if command -v rn-agent-kit >/dev/null 2>&1; then
|
|
49
|
+
rn-agent-kit tokens check
|
|
50
|
+
else
|
|
51
|
+
npx --yes rn-agent-kit tokens check || npm run tokens -- check
|
|
52
|
+
fi
|
|
53
|
+
else
|
|
54
|
+
echo "No design/source-snapshot.json — skipping tokens check."
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
- name: Upload coverage
|
|
58
|
+
if: always()
|
|
59
|
+
uses: actions/upload-artifact@v4.6.0
|
|
60
|
+
with:
|
|
61
|
+
name: coverage-${{ github.run_id }}
|
|
62
|
+
path: coverage/
|
|
63
|
+
if-no-files-found: ignore
|
|
64
|
+
retention-days: 14
|
|
65
|
+
|
|
66
|
+
- name: Build summary markdown
|
|
67
|
+
if: always()
|
|
68
|
+
shell: bash
|
|
69
|
+
run: |
|
|
70
|
+
{
|
|
71
|
+
echo "## CI · quality"
|
|
72
|
+
echo ""
|
|
73
|
+
echo "| Check | Result |"
|
|
74
|
+
echo "| --- | --- |"
|
|
75
|
+
echo "| \`tsc --noEmit\` | completed |"
|
|
76
|
+
echo "| eslint | completed |"
|
|
77
|
+
echo "| jest + coverage | completed |"
|
|
78
|
+
echo "| tokens check | completed (skipped if no snapshot) |"
|
|
79
|
+
echo ""
|
|
80
|
+
echo "**Job status:** \`${{ job.status }}\`"
|
|
81
|
+
echo ""
|
|
82
|
+
echo "Run: [\`${{ github.run_id }}\`](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
|
|
83
|
+
} > /tmp/ci-summary.md
|
|
84
|
+
|
|
85
|
+
- name: Comment summary on PR
|
|
86
|
+
if: github.event_name == 'pull_request' && always()
|
|
87
|
+
uses: marocchino/sticky-pull-request-comment@v2.9.0
|
|
88
|
+
with:
|
|
89
|
+
header: rn-agent-kit-ci
|
|
90
|
+
path: /tmp/ci-summary.md
|
|
91
|
+
recreate: true
|
|
92
|
+
|
|
93
|
+
- name: Comment result on Jira (from branch name)
|
|
94
|
+
if: always()
|
|
95
|
+
env:
|
|
96
|
+
JIRA_SITE_URL: ${{ secrets.JIRA_SITE_URL }}
|
|
97
|
+
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
|
|
98
|
+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
|
|
99
|
+
BRANCH: ${{ github.head_ref || github.ref_name }}
|
|
100
|
+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
101
|
+
JOB_STATUS: ${{ job.status }}
|
|
102
|
+
shell: bash
|
|
103
|
+
run: |
|
|
104
|
+
set -euo pipefail
|
|
105
|
+
if [ -z "${JIRA_SITE_URL:-}" ] || [ -z "${JIRA_EMAIL:-}" ] || [ -z "${JIRA_API_TOKEN:-}" ]; then
|
|
106
|
+
echo "JIRA_* secrets not set — skipping Jira comment."
|
|
107
|
+
exit 0
|
|
108
|
+
fi
|
|
109
|
+
KEY="$(echo "$BRANCH" | grep -oE '[A-Z][A-Z0-9]+-[0-9]+' | head -n1 || true)"
|
|
110
|
+
if [ -z "${KEY:-}" ]; then
|
|
111
|
+
echo "No Jira key in branch '$BRANCH' — skipping."
|
|
112
|
+
exit 0
|
|
113
|
+
fi
|
|
114
|
+
BODY=$(printf '%s' "CI ${JOB_STATUS}: ${RUN_URL}" | jq -Rs '{body: .}')
|
|
115
|
+
curl -sS -f -u "${JIRA_EMAIL}:${JIRA_API_TOKEN}" \
|
|
116
|
+
-H "Content-Type: application/json" \
|
|
117
|
+
-X POST \
|
|
118
|
+
"${JIRA_SITE_URL%/}/rest/api/2/issue/${KEY}/comment" \
|
|
119
|
+
-d "${BODY}"
|
|
120
|
+
echo "Commented on ${KEY}"
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Android Maestro E2E on pull requests (emulator + KVM).
|
|
2
|
+
# Requires: maestro/flows/**, debug APK buildable via Expo prebuild or RN CLI Gradle.
|
|
3
|
+
name: E2E Android
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: e2e-android-${{ github.event.pull_request.number || github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
pull-requests: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
maestro-android:
|
|
18
|
+
name: maestro-android
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 60
|
|
21
|
+
env:
|
|
22
|
+
# Override in repo variables if needed: EXPO=true|false, APP_ID=com.example.app
|
|
23
|
+
APP_ID: ${{ vars.APP_ID || 'com.example.app' }}
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout
|
|
26
|
+
uses: actions/checkout@v4.2.2
|
|
27
|
+
|
|
28
|
+
- name: Enable KVM
|
|
29
|
+
run: |
|
|
30
|
+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
31
|
+
sudo udevadm control --reload-rules
|
|
32
|
+
sudo udevadm trigger --name-match=kvm
|
|
33
|
+
|
|
34
|
+
- name: Setup Node
|
|
35
|
+
uses: actions/setup-node@v4.2.0
|
|
36
|
+
with:
|
|
37
|
+
node-version: "20"
|
|
38
|
+
cache: npm
|
|
39
|
+
|
|
40
|
+
- name: Setup Java
|
|
41
|
+
uses: actions/setup-java@v4.7.0
|
|
42
|
+
with:
|
|
43
|
+
distribution: temurin
|
|
44
|
+
java-version: "17"
|
|
45
|
+
|
|
46
|
+
- name: Setup Android SDK
|
|
47
|
+
uses: android-actions/setup-android@v3.2.1
|
|
48
|
+
|
|
49
|
+
- name: Gradle cache
|
|
50
|
+
uses: actions/cache@v4.2.0
|
|
51
|
+
with:
|
|
52
|
+
path: |
|
|
53
|
+
~/.gradle/caches
|
|
54
|
+
~/.gradle/wrapper
|
|
55
|
+
android/.gradle
|
|
56
|
+
key: gradle-${{ runner.os }}-${{ hashFiles('**/gradle-wrapper.properties', '**/build.gradle*', '**/libs.versions.toml') }}
|
|
57
|
+
restore-keys: |
|
|
58
|
+
gradle-${{ runner.os }}-
|
|
59
|
+
|
|
60
|
+
- name: Install JS deps
|
|
61
|
+
run: npm ci
|
|
62
|
+
|
|
63
|
+
- name: Build debug APK
|
|
64
|
+
shell: bash
|
|
65
|
+
run: |
|
|
66
|
+
set -euo pipefail
|
|
67
|
+
if [ -f app.json ] || [ -f app.config.ts ] || [ -f app.config.js ]; then
|
|
68
|
+
echo "Expo detected — prebuild + assembleDebug"
|
|
69
|
+
npx expo prebuild --platform android --no-install || true
|
|
70
|
+
cd android
|
|
71
|
+
chmod +x gradlew
|
|
72
|
+
./gradlew assembleDebug --no-daemon
|
|
73
|
+
echo "APK_PATH=$(pwd)/app/build/outputs/apk/debug/app-debug.apk" >> "$GITHUB_ENV"
|
|
74
|
+
else
|
|
75
|
+
echo "RN CLI — gradlew assembleDebug"
|
|
76
|
+
cd android
|
|
77
|
+
chmod +x gradlew
|
|
78
|
+
./gradlew assembleDebug --no-daemon
|
|
79
|
+
echo "APK_PATH=$(pwd)/app/build/outputs/apk/debug/app-debug.apk" >> "$GITHUB_ENV"
|
|
80
|
+
fi
|
|
81
|
+
# Optional: EAS local instead — uncomment and set EAS_PROJECT_ID secret/profile
|
|
82
|
+
# npx eas-cli build --platform android --profile preview --local --non-interactive
|
|
83
|
+
test -f "${APK_PATH}"
|
|
84
|
+
|
|
85
|
+
- name: Install Maestro
|
|
86
|
+
shell: bash
|
|
87
|
+
run: |
|
|
88
|
+
curl -fsSL "https://get.maestro.mobile.dev" | bash
|
|
89
|
+
echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
|
|
90
|
+
|
|
91
|
+
- name: Run Maestro on emulator
|
|
92
|
+
uses: reactivecircus/android-emulator-runner@v2.33.0
|
|
93
|
+
with:
|
|
94
|
+
api-level: 30
|
|
95
|
+
arch: x86_64
|
|
96
|
+
target: google_apis
|
|
97
|
+
force-avd-creation: false
|
|
98
|
+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
|
99
|
+
disable-animations: true
|
|
100
|
+
script: |
|
|
101
|
+
set -euo pipefail
|
|
102
|
+
adb install -r "${APK_PATH}"
|
|
103
|
+
mkdir -p maestro-results
|
|
104
|
+
maestro test maestro/flows \
|
|
105
|
+
--format junit \
|
|
106
|
+
--output maestro-results/junit.xml \
|
|
107
|
+
--debug-output maestro-results \
|
|
108
|
+
|| STATUS=$?
|
|
109
|
+
# Capture last frames / recordings if present
|
|
110
|
+
adb exec-out screencap -p > maestro-results/final.png || true
|
|
111
|
+
exit ${STATUS:-0}
|
|
112
|
+
|
|
113
|
+
- name: Upload Maestro artifacts
|
|
114
|
+
if: always()
|
|
115
|
+
uses: actions/upload-artifact@v4.6.0
|
|
116
|
+
with:
|
|
117
|
+
name: maestro-android-${{ github.run_id }}
|
|
118
|
+
path: |
|
|
119
|
+
maestro-results/
|
|
120
|
+
~/.maestro/tests/
|
|
121
|
+
if-no-files-found: ignore
|
|
122
|
+
retention-days: 14
|
|
123
|
+
|
|
124
|
+
- name: PR summary comment
|
|
125
|
+
if: github.event_name == 'pull_request' && always()
|
|
126
|
+
uses: marocchino/sticky-pull-request-comment@v2.9.0
|
|
127
|
+
with:
|
|
128
|
+
header: rn-agent-kit-e2e-android
|
|
129
|
+
message: |
|
|
130
|
+
## E2E Android (Maestro)
|
|
131
|
+
**Status:** `${{ job.status }}`
|
|
132
|
+
Artifacts: `maestro-android-${{ github.run_id }}` (junit, screenshots, debug output)
|
|
133
|
+
[Run ${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
134
|
+
|
|
135
|
+
- name: Comment result on Jira
|
|
136
|
+
if: always()
|
|
137
|
+
env:
|
|
138
|
+
JIRA_SITE_URL: ${{ secrets.JIRA_SITE_URL }}
|
|
139
|
+
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
|
|
140
|
+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
|
|
141
|
+
BRANCH: ${{ github.head_ref || github.ref_name }}
|
|
142
|
+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
143
|
+
JOB_STATUS: ${{ job.status }}
|
|
144
|
+
shell: bash
|
|
145
|
+
run: |
|
|
146
|
+
set -euo pipefail
|
|
147
|
+
if [ -z "${JIRA_SITE_URL:-}" ] || [ -z "${JIRA_EMAIL:-}" ] || [ -z "${JIRA_API_TOKEN:-}" ]; then
|
|
148
|
+
echo "JIRA_* secrets not set — skipping."
|
|
149
|
+
exit 0
|
|
150
|
+
fi
|
|
151
|
+
KEY="$(echo "$BRANCH" | grep -oE '[A-Z][A-Z0-9]+-[0-9]+' | head -n1 || true)"
|
|
152
|
+
[ -n "${KEY:-}" ] || { echo "No Jira key in branch"; exit 0; }
|
|
153
|
+
BODY=$(printf '%s' "E2E Android ${JOB_STATUS}: ${RUN_URL}" | jq -Rs '{body: .}')
|
|
154
|
+
curl -sS -f -u "${JIRA_EMAIL}:${JIRA_API_TOKEN}" \
|
|
155
|
+
-H "Content-Type: application/json" \
|
|
156
|
+
-X POST \
|
|
157
|
+
"${JIRA_SITE_URL%/}/rest/api/2/issue/${KEY}/comment" \
|
|
158
|
+
-d "${BODY}"
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# iOS Maestro E2E — NOT on every PR by default (macOS minutes are expensive).
|
|
2
|
+
#
|
|
3
|
+
# Cost trade-off:
|
|
4
|
+
# - ubuntu Android emulator PRs ≈ cheaper continuous feedback for most flows
|
|
5
|
+
# - macOS runners bill at a higher multiplier; running on every PR can dominate Actions spend
|
|
6
|
+
# - This workflow runs on: push to main, nightly cron, and workflow_dispatch (manual)
|
|
7
|
+
# - Enable pull_request only if the team accepts the cost or uses a labeled/path filter
|
|
8
|
+
#
|
|
9
|
+
name: E2E iOS
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
push:
|
|
13
|
+
branches: [main, master]
|
|
14
|
+
schedule:
|
|
15
|
+
# Nightly 05:15 UTC
|
|
16
|
+
- cron: "15 5 * * *"
|
|
17
|
+
workflow_dispatch:
|
|
18
|
+
|
|
19
|
+
concurrency:
|
|
20
|
+
group: e2e-ios-${{ github.workflow }}-${{ github.ref }}
|
|
21
|
+
cancel-in-progress: true
|
|
22
|
+
|
|
23
|
+
permissions:
|
|
24
|
+
contents: read
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
maestro-ios:
|
|
28
|
+
name: maestro-ios
|
|
29
|
+
runs-on: macos-14
|
|
30
|
+
timeout-minutes: 90
|
|
31
|
+
env:
|
|
32
|
+
APP_ID: ${{ vars.APP_ID || 'com.example.app' }}
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout
|
|
35
|
+
uses: actions/checkout@v4.2.2
|
|
36
|
+
|
|
37
|
+
- name: Setup Node
|
|
38
|
+
uses: actions/setup-node@v4.2.0
|
|
39
|
+
with:
|
|
40
|
+
node-version: "20"
|
|
41
|
+
cache: npm
|
|
42
|
+
|
|
43
|
+
- name: Install JS deps
|
|
44
|
+
run: npm ci
|
|
45
|
+
|
|
46
|
+
- name: CocoaPods cache
|
|
47
|
+
uses: actions/cache@v4.2.0
|
|
48
|
+
with:
|
|
49
|
+
path: |
|
|
50
|
+
~/Library/Caches/CocoaPods
|
|
51
|
+
ios/Pods
|
|
52
|
+
key: pods-${{ runner.os }}-${{ hashFiles('**/Podfile.lock') }}
|
|
53
|
+
restore-keys: |
|
|
54
|
+
pods-${{ runner.os }}-
|
|
55
|
+
|
|
56
|
+
- name: Build iOS Simulator app
|
|
57
|
+
shell: bash
|
|
58
|
+
run: |
|
|
59
|
+
set -euo pipefail
|
|
60
|
+
if [ -f app.json ] || [ -f app.config.ts ] || [ -f app.config.js ]; then
|
|
61
|
+
echo "Expo — prebuild ios + xcodebuild"
|
|
62
|
+
npx expo prebuild --platform ios --no-install || true
|
|
63
|
+
fi
|
|
64
|
+
cd ios
|
|
65
|
+
pod install
|
|
66
|
+
WORKSPACE="$(ls -1 *.xcworkspace 2>/dev/null | head -n1)"
|
|
67
|
+
test -n "${WORKSPACE}"
|
|
68
|
+
SCHEME="$(xcodebuild -list -json -workspace "${WORKSPACE}" | jq -r '.workspace.schemes[0]')"
|
|
69
|
+
DEST='platform=iOS Simulator,name=iPhone 16'
|
|
70
|
+
xcodebuild \
|
|
71
|
+
-workspace "${WORKSPACE}" \
|
|
72
|
+
-scheme "${SCHEME}" \
|
|
73
|
+
-configuration Debug \
|
|
74
|
+
-sdk iphonesimulator \
|
|
75
|
+
-destination "${DEST}" \
|
|
76
|
+
-derivedDataPath "$HOME/DerivedData" \
|
|
77
|
+
build
|
|
78
|
+
APP_PATH="$(find "$HOME/DerivedData" -name '*.app' -path '*/Debug-iphonesimulator/*' | head -n1)"
|
|
79
|
+
echo "APP_PATH=${APP_PATH}" >> "$GITHUB_ENV"
|
|
80
|
+
test -n "${APP_PATH}" && test -d "${APP_PATH}"
|
|
81
|
+
|
|
82
|
+
- name: Install Maestro
|
|
83
|
+
run: |
|
|
84
|
+
curl -fsSL "https://get.maestro.mobile.dev" | bash
|
|
85
|
+
echo "$HOME/.maestro/bin" >> "$GITHUB_PATH"
|
|
86
|
+
|
|
87
|
+
- name: Boot simulator + install + Maestro
|
|
88
|
+
shell: bash
|
|
89
|
+
run: |
|
|
90
|
+
set -euo pipefail
|
|
91
|
+
xcrun simctl boot "iPhone 16" || true
|
|
92
|
+
xcrun simctl bootstatus "iPhone 16" -b
|
|
93
|
+
xcrun simctl install booted "${APP_PATH}"
|
|
94
|
+
mkdir -p maestro-results
|
|
95
|
+
maestro test maestro/flows \
|
|
96
|
+
--format junit \
|
|
97
|
+
--output maestro-results/junit.xml \
|
|
98
|
+
--debug-output maestro-results
|
|
99
|
+
|
|
100
|
+
- name: Upload Maestro artifacts
|
|
101
|
+
if: always()
|
|
102
|
+
uses: actions/upload-artifact@v4.6.0
|
|
103
|
+
with:
|
|
104
|
+
name: maestro-ios-${{ github.run_id }}
|
|
105
|
+
path: |
|
|
106
|
+
maestro-results/
|
|
107
|
+
~/.maestro/tests/
|
|
108
|
+
if-no-files-found: ignore
|
|
109
|
+
retention-days: 14
|
|
110
|
+
|
|
111
|
+
- name: Comment result on Jira
|
|
112
|
+
if: always()
|
|
113
|
+
env:
|
|
114
|
+
JIRA_SITE_URL: ${{ secrets.JIRA_SITE_URL }}
|
|
115
|
+
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
|
|
116
|
+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
|
|
117
|
+
BRANCH: ${{ github.ref_name }}
|
|
118
|
+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
119
|
+
JOB_STATUS: ${{ job.status }}
|
|
120
|
+
shell: bash
|
|
121
|
+
run: |
|
|
122
|
+
set -euo pipefail
|
|
123
|
+
if [ -z "${JIRA_SITE_URL:-}" ] || [ -z "${JIRA_EMAIL:-}" ] || [ -z "${JIRA_API_TOKEN:-}" ]; then
|
|
124
|
+
echo "JIRA_* secrets not set — skipping."
|
|
125
|
+
exit 0
|
|
126
|
+
fi
|
|
127
|
+
KEY="$(echo "$BRANCH" | grep -oE '[A-Z][A-Z0-9]+-[0-9]+' | head -n1 || true)"
|
|
128
|
+
[ -n "${KEY:-}" ] || { echo "No Jira key (main/nightly often have none) — skipping."; exit 0; }
|
|
129
|
+
BODY=$(printf '%s' "E2E iOS ${JOB_STATUS}: ${RUN_URL}" | jq -Rs '{body: .}')
|
|
130
|
+
curl -sS -f -u "${JIRA_EMAIL}:${JIRA_API_TOKEN}" \
|
|
131
|
+
-H "Content-Type: application/json" \
|
|
132
|
+
-X POST \
|
|
133
|
+
"${JIRA_SITE_URL%/}/rest/api/2/issue/${KEY}/comment" \
|
|
134
|
+
-d "${BODY}"
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# OPTIONAL — EAS Build / Submit.
|
|
2
|
+
# Skip this file if you do not use Expo Application Services. Copy it only when the team
|
|
3
|
+
# wants cloud builds; local CI already covers lint/test/tokens + emulator E2E.
|
|
4
|
+
#
|
|
5
|
+
# Triggers: manual dispatch, or push of version tags (v*).
|
|
6
|
+
# Secrets: EXPO_TOKEN (required). Store credentials: EXPO_APPLE_* / Google via EAS, not in YAML.
|
|
7
|
+
#
|
|
8
|
+
name: EAS Build
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
inputs:
|
|
13
|
+
platform:
|
|
14
|
+
description: ios | android | all
|
|
15
|
+
required: true
|
|
16
|
+
default: all
|
|
17
|
+
type: choice
|
|
18
|
+
options: [ios, android, all]
|
|
19
|
+
profile:
|
|
20
|
+
description: eas.json profile
|
|
21
|
+
required: true
|
|
22
|
+
default: production
|
|
23
|
+
type: string
|
|
24
|
+
submit:
|
|
25
|
+
description: Also run eas submit after a successful build
|
|
26
|
+
required: true
|
|
27
|
+
default: false
|
|
28
|
+
type: boolean
|
|
29
|
+
push:
|
|
30
|
+
tags:
|
|
31
|
+
- "v*"
|
|
32
|
+
|
|
33
|
+
concurrency:
|
|
34
|
+
group: eas-build-${{ github.ref }}
|
|
35
|
+
cancel-in-progress: false
|
|
36
|
+
|
|
37
|
+
permissions:
|
|
38
|
+
contents: read
|
|
39
|
+
|
|
40
|
+
jobs:
|
|
41
|
+
eas:
|
|
42
|
+
name: eas-${{ github.event.inputs.platform || 'all' }}
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
timeout-minutes: 120
|
|
45
|
+
# Guard: do nothing useful without EXPO_TOKEN (job still starts; step fails clearly).
|
|
46
|
+
steps:
|
|
47
|
+
- name: Checkout
|
|
48
|
+
uses: actions/checkout@v4.2.2
|
|
49
|
+
|
|
50
|
+
- name: Setup Node
|
|
51
|
+
uses: actions/setup-node@v4.2.0
|
|
52
|
+
with:
|
|
53
|
+
node-version: "20"
|
|
54
|
+
cache: npm
|
|
55
|
+
|
|
56
|
+
- name: Install
|
|
57
|
+
run: npm ci
|
|
58
|
+
|
|
59
|
+
- name: Setup EAS
|
|
60
|
+
uses: expo/expo-github-action@v8
|
|
61
|
+
with:
|
|
62
|
+
eas-version: latest
|
|
63
|
+
token: ${{ secrets.EXPO_TOKEN }}
|
|
64
|
+
|
|
65
|
+
- name: EAS Build
|
|
66
|
+
env:
|
|
67
|
+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
|
68
|
+
run: |
|
|
69
|
+
set -euo pipefail
|
|
70
|
+
if [ -z "${EXPO_TOKEN:-}" ]; then
|
|
71
|
+
echo "::error::EXPO_TOKEN secret is required for EAS. Skip this workflow if you do not use EAS."
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
74
|
+
PLATFORM="${{ github.event.inputs.platform || 'all' }}"
|
|
75
|
+
PROFILE="${{ github.event.inputs.profile || 'production' }}"
|
|
76
|
+
if [ "$PLATFORM" = "all" ]; then
|
|
77
|
+
eas build --platform all --profile "$PROFILE" --non-interactive --no-wait
|
|
78
|
+
else
|
|
79
|
+
eas build --platform "$PLATFORM" --profile "$PROFILE" --non-interactive --no-wait
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
- name: EAS Submit (optional)
|
|
83
|
+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.submit == true }}
|
|
84
|
+
env:
|
|
85
|
+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
|
|
86
|
+
run: |
|
|
87
|
+
PLATFORM="${{ github.event.inputs.platform }}"
|
|
88
|
+
PROFILE="${{ github.event.inputs.profile || 'production' }}"
|
|
89
|
+
if [ "$PLATFORM" = "all" ]; then
|
|
90
|
+
eas submit --platform ios --profile "$PROFILE" --latest --non-interactive || true
|
|
91
|
+
eas submit --platform android --profile "$PROFILE" --latest --non-interactive || true
|
|
92
|
+
else
|
|
93
|
+
eas submit --platform "$PLATFORM" --profile "$PROFILE" --latest --non-interactive
|
|
94
|
+
fi
|