Commit 70623c5
committed
feat(ci): optimize shell script validation with parallel processing
• Implement parallel validation using xargs -P for faster execution
• Determine optimal parallelism based on CPU cores (max 8 for GitHub Actions)
• Replace serial for-loop with parallel processing to reduce CI execution time
• Add proper error handling and exit code propagation in parallel execution
• Maintain clear error reporting that identifies which specific scripts failed
• Use temporary files to collect validation results from parallel processes
• Export validation function for use by xargs subprocess execution
• Preserve existing validation behavior and error message formatting
Performance Improvements:
- Parallel execution scales with available CPU cores
- Significantly faster validation for repositories with many shell scripts
- Optimal resource utilization without overwhelming GitHub Actions runners
- Maintains backward compatibility with existing script validation expectations
Technical Implementation:
- Use nproc to detect available CPU cores, capped at 8 for stability
- Export bash function for subprocess access in parallel execution
- Temporary files for result aggregation from parallel processes
- Proper cleanup of temporary files regardless of success/failure outcome
- Clear progress indication with parallel process count logging1 parent cc4f7d8 commit 70623c5
1 file changed
+48
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
133 | 140 | | |
134 | 141 | | |
135 | 142 | | |
| 143 | + | |
136 | 144 | | |
137 | 145 | | |
138 | 146 | | |
139 | | - | |
| 147 | + | |
| 148 | + | |
140 | 149 | | |
141 | 150 | | |
142 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
143 | 173 | | |
144 | 174 | | |
145 | | - | |
| 175 | + | |
146 | 176 | | |
147 | 177 | | |
148 | | - | |
149 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
150 | 184 | | |
151 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
152 | 189 | | |
153 | 190 | | |
154 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
155 | 195 | | |
156 | 196 | | |
157 | 197 | | |
| |||
0 commit comments