Skip to content

Commit fa3b91d

Browse files
Add Star History chart, GitHub Actions CI, and update CHANGELOG
- Star History chart in both READMEs for social proof - GitHub Actions CI: monthly syntax check + structure validation - CI badge in README header - CHANGELOG v1.2.0
1 parent ebfb390 commit fa3b91d

4 files changed

Lines changed: 92 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Tutorial Validation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# Run monthly on the 1st at 08:00 UTC
10+
- cron: '0 8 1 * *'
11+
workflow_dispatch: # Allow manual trigger
12+
13+
jobs:
14+
validate-tutorials:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Validate MATLAB scripts (syntax check)
21+
run: |
22+
echo "=== Checking .m script syntax ==="
23+
scripts=$(ls t*.m run_all_tutorials.m 2>/dev/null)
24+
errors=0
25+
for f in $scripts; do
26+
# Basic syntax checks: balanced parentheses, brackets, etc.
27+
opens=$(tr -cd '(' < "$f" | wc -c)
28+
closes=$(tr -cd ')' < "$f" | wc -c)
29+
if [ "$opens" != "$closes" ]; then
30+
echo " WARN: $f has unbalanced parentheses ($opens open, $closes close)"
31+
fi
32+
# Check for common MATLAB syntax issues
33+
if grep -n 'bode([^)]*);[[:space:]]*$' "$f" > /dev/null 2>&1; then
34+
echo " WARN: $f may have bode() call without output args (creates new figure)"
35+
fi
36+
if grep -n 'sigma([^)]*);[[:space:]]*$' "$f" > /dev/null 2>&1; then
37+
echo " WARN: $f may have sigma() call without output args (creates new figure)"
38+
fi
39+
done
40+
echo "=== Syntax check complete ==="
41+
42+
- name: Validate HTML documentation
43+
run: |
44+
echo "=== Checking HTML file ==="
45+
if [ -f "Simulink学习笔记.html" ]; then
46+
# Check for balanced HTML tags
47+
errors=$(grep -c '</' "Simulink学习笔记.html" || true)
48+
echo " HTML file exists with $errors closing tags"
49+
fi
50+
echo "=== HTML check complete ==="
51+
52+
- name: Check project structure
53+
run: |
54+
echo "=== Checking project structure ==="
55+
expected_count=21
56+
actual_count=$(ls t[0-9]*.m 2>/dev/null | wc -l)
57+
echo " Tutorial scripts found: $actual_count (expected ≥ $expected_count)"
58+
echo " .slx models: $(ls models/*.slx 2>/dev/null | wc -l)"
59+
echo " Generated images: $(ls docs/images/*.png 2>/dev/null | wc -l)"
60+
echo "=== Structure check complete ==="

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project are documented here.
44

5+
## [1.2.0] - 2026-07-18
6+
7+
### Added
8+
- Star History chart in README (中文/English)
9+
- GitHub Actions CI workflow: syntax check, structure validation, monthly schedule
10+
- CI passing badge in README
11+
12+
### Changed
13+
- Updated all simulation images and models from latest run
14+
515
## [1.1.0] - 2026-07-17
616

717
### Added

‎README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<img src="https://img.shields.io/badge/Language-中文-red?style=flat-square" alt="Chinese">
77
<img src="https://img.shields.io/github/stars/xingd5478-ctrl/simulink-control-tutorial?style=flat-square" alt="Stars">
88
<img src="https://img.shields.io/github/last-commit/xingd5478-ctrl/simulink-control-tutorial?style=flat-square" alt="Last Commit">
9+
<img src="https://img.shields.io/github/actions/workflow/status/xingd5478-ctrl/simulink-control-tutorial/ci.yml?style=flat-square&label=CI" alt="CI">
910
</p>
1011

1112
<h1 align="center">Simulink 控制工程教程</h1>
@@ -258,6 +259,16 @@ t01-t08 基础操作 ──→ t09 状态空间 ──→ t10 LQR 控制
258259

259260
详见 [CONTRIBUTING.md](CONTRIBUTING.md)。
260261

262+
## Star History
263+
264+
<a href="https://star-history.com/#xingd5478-ctrl/simulink-control-tutorial&Date">
265+
<picture>
266+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xingd5478-ctrl/simulink-control-tutorial&type=Date&theme=dark" />
267+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xingd5478-ctrl/simulink-control-tutorial&type=Date" />
268+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xingd5478-ctrl/simulink-control-tutorial&type=Date" />
269+
</picture>
270+
</a>
271+
261272
---
262273

263274
## License

‎README_EN.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<img src="https://img.shields.io/badge/Language-English%7C%E4%B8%AD%E6%96%87-blue?style=flat-square" alt="Bilingual">
77
<img src="https://img.shields.io/github/stars/xingd5478-ctrl/simulink-control-tutorial?style=flat-square" alt="Stars">
88
<img src="https://img.shields.io/github/last-commit/xingd5478-ctrl/simulink-control-tutorial?style=flat-square" alt="Last Commit">
9+
<img src="https://img.shields.io/github/actions/workflow/status/xingd5478-ctrl/simulink-control-tutorial/ci.yml?style=flat-square&label=CI" alt="CI">
910
</p>
1011

1112
<h1 align="center">Simulink Control Engineering Tutorial</h1>
@@ -213,6 +214,16 @@ Issues and PRs are welcome! Bug reports, new tutorial ideas, and documentation i
213214

214215
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
215216

217+
## Star History
218+
219+
<a href="https://star-history.com/#xingd5478-ctrl/simulink-control-tutorial&Date">
220+
<picture>
221+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=xingd5478-ctrl/simulink-control-tutorial&type=Date&theme=dark" />
222+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=xingd5478-ctrl/simulink-control-tutorial&type=Date" />
223+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=xingd5478-ctrl/simulink-control-tutorial&type=Date" />
224+
</picture>
225+
</a>
226+
216227
---
217228

218229
## License

0 commit comments

Comments
 (0)