-
Notifications
You must be signed in to change notification settings - Fork 0
174 lines (150 loc) · 5.43 KB
/
ci.yml
File metadata and controls
174 lines (150 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: CI Pipeline
on:
push:
branches: [ main, develop, feature/* ]
pull_request:
branches: [ main ]
jobs:
test-documentation:
name: Test Markdown Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install markdownlint
run: |
echo "INFO ==>: Installing markdownlint..."
npm install -g markdownlint-cli
- name: Run markdownlint
run: |
echo "INFO ==>: Checking markdown files..."
markdownlint '**/*.md' --ignore node_modules --config .markdownlint.json || true
echo "INFO ==>: Markdown check completed!"
test-on-macos:
name: Test Installation on macOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check Homebrew
run: |
echo "INFO ==>: Checking Homebrew installation..."
brew --version
echo "INFO ==>: Homebrew is working!"
- name: Validate Brewfile
run: |
echo "INFO ==>: Validating Brewfile syntax..."
brew bundle check --file=Brewfile --verbose || echo "Some packages not installed (expected in CI)"
echo "INFO ==>: Brewfile syntax is valid!"
- name: Check script permissions
run: |
echo "INFO ==>: Checking if scripts are executable..."
for script in install.sh scripts/*.sh; do
if [ -f "$script" ]; then
echo "Checking $script"
if [ ! -x "$script" ]; then
echo "ERROR: $script is not executable"
exit 1
fi
fi
done
echo "INFO ==>: All scripts have correct permissions!"
- name: Dry-run install script
run: |
echo "INFO ==>: Testing install.sh (dry-run)..."
bash -n install.sh
echo "INFO ==>: install.sh syntax is valid!"
- name: Test all scripts syntax
run: |
echo "INFO ==>: Testing all scripts syntax..."
for script in scripts/*.sh; do
if [ -f "$script" ]; then
echo "Testing $script"
bash -n "$script"
fi
done
echo "INFO ==>: All scripts have valid syntax!"
test-project-structure:
name: Validate Project Structure
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check required files
run: |
echo "INFO ==>: Checking project structure..."
required_files=(
"README.md"
"LICENSE"
"Brewfile"
"install.sh"
"scripts/brew.sh"
"scripts/cli-tools.sh"
"scripts/kubernetes.sh"
"scripts/cloud-tools.sh"
"scripts/desktop-apps.sh"
"scripts/symlink-dotfiles.sh"
"scripts/macos-preferences.sh"
"scripts/oh-my-zsh.sh"
"dotfiles/.zshrc"
"configs/gitconfig-template"
"configs/k9s-aliases.yaml"
"docs/index.html"
"docs/banner.svg"
)
all_found=true
for file in "${required_files[@]}"; do
if [ ! -f "$file" ]; then
echo "ERROR: Missing required file: $file"
all_found=false
else
echo "✓ Found: $file"
fi
done
if [ "$all_found" = true ]; then
echo "INFO ==>: All required files present!"
else
echo "ERROR: Some required files are missing!"
exit 1
fi
- name: Check coding style
run: |
echo "INFO ==>: Checking if scripts follow coding style..."
scripts_ok=true
for script in scripts/*.sh install.sh; do
if [ -f "$script" ]; then
if ! grep -q "INFO ==>:" "$script"; then
echo "WARNING: $script might not follow 'INFO ==>:' style"
scripts_ok=false
else
echo "✓ $script follows coding style"
fi
fi
done
if [ "$scripts_ok" = true ]; then
echo "INFO ==>: All scripts follow coding style!"
else
echo "WARNING: Some scripts might need style updates"
fi
summary:
name: Build Summary
runs-on: ubuntu-latest
needs: [test-documentation, test-on-macos, test-project-structure]
steps:
- name: Success message
run: |
echo "╔════════════════════════════════════════╗"
echo "║ ║"
echo "║ ✅ All CI checks passed! ║"
echo "║ ║"
echo "║ - Documentation checked ✓ ║"
echo "║ - macOS compatibility tested ✓ ║"
echo "║ - Project structure verified ✓ ║"
echo "║ ║"
echo "║ Ready to merge! 🚀 ║"
echo "║ ║"
echo "╔════════════════════════════════════════╗"