This commit is contained in:
Dmitry 2025-11-21 03:37:57 +03:00
parent 55c4f064f7
commit 6f9ba30753

View file

@ -11,12 +11,41 @@ on:
- web_v2
- backend
- common
schedule:
# Run every 30 minutes
- cron: '*/30 * * * *'
# Other schedule options (uncomment to use):
# Run every 15 minutes
# - cron: '*/15 * * * *'
# Run every hour
# - cron: '0 * * * *'
# Run every 6 hours (at 2:00, 8:00, 14:00, 20:00 UTC)
# - cron: '0 */6 * * *'
# Run every day at 2:00 AM UTC (5:00 AM MSK)
# - cron: '0 2 * * *'
# Run every day at 9:00 AM UTC (12:00 PM MSK)
# - cron: '0 9 * * *'
jobs:
development:
runs-on: ubuntu-latest
container: ghcr.io/cirruslabs/flutter:3.35.5
timeout-minutes: 360 # 6 hours
# For scheduled runs, use matrix to run all components
# For manual runs, use input component
strategy:
matrix:
component: [web_v2, backend, common]
fail-fast: false
# Only use matrix for scheduled runs (when inputs.component is not set)
# For workflow_dispatch, matrix will be ignored and inputs.component will be used
env:
# Use input component if provided (workflow_dispatch), otherwise use matrix component (schedule)
COMPONENT: ${{ inputs.component || matrix.component }}
# For workflow_dispatch, only run the selected component
# For schedule, run all components (matrix will create jobs for all)
if: github.event_name == 'schedule' || inputs.component == '' || inputs.component == matrix.component
steps:
- name: Install Node.js
@ -80,23 +109,19 @@ jobs:
git config --global user.name "AI Agent"
git config --global user.email "ai-agent@mnemo-cards.com"
- name: Install Dependencies (web_v2)
if: inputs.component == 'web_v2'
- name: Install Dependencies
run: |
cd mnemo_cards_web_v2
flutter pub get
- name: Install Dependencies (backend)
if: inputs.component == 'backend'
run: |
cd mnemo_cards_backend
dart pub get
- name: Install Dependencies (common)
if: inputs.component == 'common'
run: |
cd mnemo_cards_common
dart pub get
COMPONENT="${{ env.COMPONENT }}"
if [ "$COMPONENT" == "web_v2" ]; then
cd mnemo_cards_web_v2
flutter pub get
elif [ "$COMPONENT" == "backend" ]; then
cd mnemo_cards_backend
dart pub get
elif [ "$COMPONENT" == "common" ]; then
cd mnemo_cards_common
dart pub get
fi
- name: Run Development Agent
env:
@ -130,12 +155,12 @@ jobs:
fi
cd ${{ github.workspace }}
python3 tools/agent/agent_orchestrator.py ${{ inputs.component }}
python3 tools/agent/agent_orchestrator.py ${{ env.COMPONENT }}
- name: Create Summary Report
if: always()
run: |
COMPONENT="${{ inputs.component }}"
COMPONENT="${{ env.COMPONENT }}"
STATE_FILE="ai_docs/agent/${COMPONENT}/agent_state.json"
echo "# Development Agent Summary" > /tmp/summary.md
@ -156,7 +181,7 @@ jobs:
- name: Check if all tasks completed
id: check_completion
run: |
COMPONENT="${{ inputs.component }}"
COMPONENT="${{ env.COMPONENT }}"
STATE_FILE="ai_docs/agent/${COMPONENT}/agent_state.json"
TASK_LIST="ai_docs/agent/${COMPONENT}/task_list.json"
@ -196,7 +221,7 @@ jobs:
cat /tmp/completion_status.txt >> $GITHUB_OUTPUT
env:
COMPONENT: ${{ inputs.component }}
COMPONENT: ${{ env.COMPONENT }}
- name: Trigger Planning Agent (if all completed)
if: contains(steps.check_completion.outputs.*, 'all_completed=true')