Revert "fix: improve iOS CI workflow with pipefail, fix Python indentation, add setup docs"

This reverts commit c1cbc02826.
This commit is contained in:
2026-06-26 20:46:30 +00:00
parent c1cbc02826
commit 36658fe7d1
2 changed files with 35 additions and 330 deletions

View File

@@ -55,15 +55,14 @@ jobs:
cd tabatago-swift
xcodegen generate
- name: Build for iPhone
- name: Build & Install on iPhone
env:
IPHONE_UDID: ${{ secrets.IPHONE_UDID }}
run: |
cd tabatago-swift
# Build for device (build only — installation requires USB/OTA tooling)
# Use tee to capture full log while showing last 40 lines on stdout
set -o pipefail
# Use tee to capture full output while still streaming to stdout
xcodebuild build \
-scheme TabataGo \
-sdk iphoneos \
@@ -75,7 +74,7 @@ jobs:
CODE_SIGN_STYLE=Automatic \
2>&1 | tee ../build/xcodebuild.log | tail -40
BUILD_EXIT=$?
BUILD_EXIT=${PIPESTATUS[0]}
if [ $BUILD_EXIT -ne 0 ]; then
echo ""
echo "❌ Build FAILED (exit code: $BUILD_EXIT)"
@@ -96,7 +95,7 @@ jobs:
REPO="${{ github.repository }}"
RESP=$(curl -sk -w "\n%{http_code}" -X POST \
-H "Authorization: token $GITEA_TOKEN \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"body":"## 📱 Prêt à tester !\n\nL'"'"'app a été buildée pour ton iPhone.\n\n- Teste les changements\n- Reply **LGTM** pour merger\n- Reply **KO** pour bloquer"}' \
"${GITEA_HOST}/api/v1/repos/${REPO}/issues/${PR}/comments")
@@ -137,7 +136,7 @@ jobs:
# Récupérer le dernier ID de commentaire existant comme point de départ
LAST_ID=$(curl -sk \
-H "Authorization: token $GITEA_TOKEN \
-H "Authorization: token ${GITEA_TOKEN}" \
"${API}/issues/${PR_NUMBER}/comments" | \
python3 -c "import json,sys; cs=json.load(sys.stdin); print(cs[-1]['id'] if isinstance(cs,list) and cs else 0)" 2>/dev/null || echo 0)
@@ -151,7 +150,7 @@ jobs:
# Récupérer tous les commentaires
COMMENTS=$(curl -sk \
-H "Authorization: token $GITEA_TOKEN \
-H "Authorization: token ${GITEA_TOKEN}" \
"${API}/issues/${PR_NUMBER}/comments" 2>/dev/null)
if [ -z "$COMMENTS" ]; then
@@ -160,12 +159,12 @@ jobs:
# Vérifier les nouveaux commentaires (ID > LAST_ID)
NEW_COMMENTS=$(echo "$COMMENTS" | python3 -c "
import json, sys
last_id = $LAST_ID
cs = json.load(sys.stdin)
new = [c for c in cs if isinstance(c, dict) and c.get('id', 0) > last_id]
print(json.dumps(new))
" 2>/dev/null)
import json, sys
last_id = $LAST_ID
cs = json.load(sys.stdin)
new = [c for c in cs if isinstance(c, dict) and c.get('id', 0) > last_id]
print(json.dumps(new))
" 2>/dev/null)
if [ -z "$NEW_COMMENTS" ] || [ "$NEW_COMMENTS" = "[]" ]; then
# Petit heartbeat toutes les 2 min
@@ -177,28 +176,28 @@ jobs:
# Mettre à jour LAST_ID au plus récent
LAST_ID=$(echo "$COMMENTS" | python3 -c "
import json, sys
cs = json.load(sys.stdin)
ids = [c['id'] for c in cs if isinstance(c, dict)]
print(max(ids) if ids else 0)
" 2>/dev/null || echo "$LAST_ID")
import json, sys
cs = json.load(sys.stdin)
ids = [c['id'] for c in cs if isinstance(c, dict)]
print(max(ids) if ids else 0)
" 2>/dev/null || echo "$LAST_ID")
# Vérifier LGTM (insensible à la casse, dans le texte du commentaire)
if echo "$NEW_COMMENTS" | python3 -c "
import json, sys
cs = json.load(sys.stdin)
for c in cs:
body = c.get('body', '')
if 'lgtm' in body.strip().lower():
print('MATCH')
break
" 2>/dev/null | grep -q MATCH; then
import json, sys
cs = json.load(sys.stdin)
for c in cs:
body = c.get('body', '')
if 'lgtm' in body.strip().lower():
print('MATCH')
break
" 2>/dev/null | grep -q MATCH; then
echo ""
echo "✅ LGTM reçu ! Merge de la PR..."
MERGE_RESP=$(curl -sk -w "\n%{http_code}" -X POST \
-H "Authorization: token $GITEA_TOKEN \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"Do\":\"merge\"}" \
-d "{\"Do\":\"merge\",\"MergeTitle\":\"${{ github.event.pull_request.title }}\"}" \
"${API}/pulls/${PR_NUMBER}/merge")
MERGE_HTTP=$(echo "$MERGE_RESP" | tail -1)
@@ -215,14 +214,14 @@ jobs:
# Vérifier KO (insensible à la casse)
if echo "$NEW_COMMENTS" | python3 -c "
import json, sys
cs = json.load(sys.stdin)
for c in cs:
body = c.get('body', '')
if body.strip().lower() == 'ko':
print('MATCH')
break
" 2>/dev/null | grep -q MATCH; then
import json, sys
cs = json.load(sys.stdin)
for c in cs:
body = c.get('body', '')
if body.strip().lower() == 'ko':
print('MATCH')
break
" 2>/dev/null | grep -q MATCH; then
echo ""
echo "❌ KO reçu. PR bloquée."
exit 1