16
16
jobs :
17
17
generate-config :
18
18
runs-on : ubuntu-latest
19
-
19
+
20
20
steps :
21
21
- name : Checkout repository
22
22
uses : actions/checkout@v4
23
23
with :
24
24
fetch-depth : 0
25
-
25
+
26
26
- name : Set up Python
27
27
uses : actions/setup-python@v4
28
28
with :
29
29
python-version : ' 3.9'
30
-
30
+
31
31
- name : Cache pip dependencies
32
32
uses : actions/cache@v3
33
33
with :
34
34
path : ~/.cache/pip
35
35
key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '**/pyproject.toml') }}
36
36
restore-keys : |
37
37
${{ runner.os }}-pip-
38
-
38
+
39
39
- name : Install dependencies
40
40
run : |
41
41
python -m pip install --upgrade pip
@@ -47,18 +47,18 @@ jobs:
47
47
fi
48
48
# Install additional dependencies that might be needed
49
49
pip install pathlib datetime
50
-
50
+
51
51
- name : Create docs directory
52
52
run : |
53
53
mkdir -p docs
54
-
54
+
55
55
- name : Run model configuration generator
56
56
run : |
57
57
cd ${{ github.workspace }}
58
58
python tests/generate_model_config.py
59
59
env :
60
60
PYTHONPATH : ${{ github.workspace }}/src
61
-
61
+
62
62
- name : Check if model config was generated
63
63
run : |
64
64
if [ -f docs/model_config.js ]; then
@@ -72,52 +72,52 @@ jobs:
72
72
echo "❌ Model configuration file was not generated"
73
73
exit 1
74
74
fi
75
-
75
+
76
76
- name : Commit and push changes
77
77
if : github.event_name != 'pull_request'
78
78
run : |
79
79
git config --local user.email "[email protected] "
80
80
git config --local user.name "GitHub Action"
81
-
81
+
82
82
if [ -n "$(git status --porcelain docs/model_config.js)" ]; then
83
83
git add docs/model_config.js
84
84
git commit -m "🤖 Auto-update model configuration
85
-
85
+
86
86
- Generated from EMD Python model definitions
87
87
- Updated at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
88
88
- Triggered by: ${{ github.event_name }}
89
89
- Commit: ${{ github.sha }}"
90
-
90
+
91
91
git push
92
92
echo "✅ Model configuration updated and committed"
93
93
else
94
94
echo "ℹ️ No changes to model configuration"
95
95
fi
96
-
96
+
97
97
- name : Upload model config as artifact
98
98
uses : actions/upload-artifact@v3
99
99
with :
100
100
name : model-config
101
101
path : docs/model_config.js
102
102
retention-days : 30
103
-
103
+
104
104
- name : Generate summary
105
105
run : |
106
106
echo "## 📊 Model Configuration Generation Summary" >> $GITHUB_STEP_SUMMARY
107
107
echo "" >> $GITHUB_STEP_SUMMARY
108
-
108
+
109
109
if [ -f docs/model_config.js ]; then
110
110
echo "✅ **Status**: Successfully generated" >> $GITHUB_STEP_SUMMARY
111
111
echo "📁 **Output**: \`docs/model_config.js\`" >> $GITHUB_STEP_SUMMARY
112
112
echo "📏 **Size**: $(wc -c < docs/model_config.js) bytes" >> $GITHUB_STEP_SUMMARY
113
113
echo "📄 **Lines**: $(wc -l < docs/model_config.js)" >> $GITHUB_STEP_SUMMARY
114
114
echo "" >> $GITHUB_STEP_SUMMARY
115
-
115
+
116
116
# Extract model count from the generated file if possible
117
117
if grep -q "getModelCount" docs/model_config.js; then
118
118
echo "🎯 **Generated**: Model configuration with helper functions" >> $GITHUB_STEP_SUMMARY
119
119
fi
120
-
120
+
121
121
echo "" >> $GITHUB_STEP_SUMMARY
122
122
echo "### 📋 Generated Configuration Includes:" >> $GITHUB_STEP_SUMMARY
123
123
echo "- 🤖 Model definitions and metadata" >> $GITHUB_STEP_SUMMARY
@@ -128,4 +128,4 @@ jobs:
128
128
else
129
129
echo "❌ **Status**: Generation failed" >> $GITHUB_STEP_SUMMARY
130
130
echo "Please check the workflow logs for details." >> $GITHUB_STEP_SUMMARY
131
- fi
131
+ fi
0 commit comments