-
Notifications
You must be signed in to change notification settings - Fork 85
148 lines (124 loc) · 4.5 KB
/
Copy pathci.yml
File metadata and controls
148 lines (124 loc) · 4.5 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
name: CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Setup uv
uses: astral-sh/setup-uv@v7
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Check formatting
run: |
for i in 1 2 3; do
dotnet format --verify-no-changes --verbosity diagnostic WinHome.sln && break
sleep 10
done
- name: Check Python formatting
run: |
uv tool run ruff check plugins/
uv tool run ruff format --check plugins/
- name: Check JS/TS formatting
run: bun x prettier --check plugins/
- name: Build
run: dotnet build WinHome.sln
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore src/WinHome.csproj
- name: Install uv and bun
shell: pwsh
run: |
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
echo "$env:USERPROFILE\.cargo\bin" >> $env:GITHUB_PATH
powershell -ExecutionPolicy ByPass -c "irm https://bun.sh/install.ps1 | iex"
echo "$env:USERPROFILE\.bun\bin" >> $env:GITHUB_PATH
- name: Run tests
run: dotnet test tests/WinHome.Tests/WinHome.Tests.csproj
- name: Build WinHome
run: dotnet publish src/WinHome.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o publish
- name: Run GHA tests
shell: pwsh
run: |
cd publish
cp ../test-data/test-config-gha.yaml .
cp ../test-data/run-test-gha.ps1 .
cp ../test-data/verify-gha.ps1 .
cp ../README.md .
./run-test-gha.ps1
- name: Test plugin action downloads
shell: bash
run: |
echo "Testing action downloads for all 72 plugins..."
cd plugins
TOTAL=0
FAILED=0
for plugin_dir in */; do
plugin_name=$(basename "${plugin_dir}")
if [[ "$plugin_name" == "__pycache__" || "$plugin_name" == "." ]]; then
continue
fi
cd "$plugin_dir"
TOTAL=$((TOTAL + 1))
if [[ -f "plugin.yaml" ]]; then
# For Python plugins
if grep -q '"type: python"' plugin.yaml; then
if [[ -f "src/plugin.py" ]]; then
echo "✓ $plugin_name: Python plugin exists"
else
echo "❌ $plugin_name: Python plugin exists but missing src/plugin.py"
FAILED=$((FAILED + 1))
fi
# For JavaScript/TypeScript plugins
elif grep -q '"type: javascript"' plugin.yaml || grep -q '"type: typescript"' plugin.yaml; then
if [[ -f "src/plugin.ts" ]] || [[ -f "src/plugin.js" ]] || [[ -f "package.json" ]]; then
echo "✓ $plugin_name: JavaScript plugin exists"
else
echo "❌ $plugin_name: JavaScript plugin exists but missing src/plugin and package.json"
FAILED=$((FAILED + 1))
fi
# For PowerShell plugins
elif grep -q '"type: powershell"' plugin.yaml; then
if [[ -f "src/plugin.ps1" ]]; then
echo "✓ $plugin_name: PowerShell plugin exists"
else
echo "❌ $plugin_name: PowerShell plugin exists but missing src/plugin.ps1"
FAILED=$((FAILED + 1))
fi
else
echo "⚠️ $plugin_name: Unknown plugin type"
fi
else
echo "⚠️ $plugin_name: No plugin.yaml found (test plugin)"
fi
cd ..
done
echo "Plugin action download test completed."
echo "Total plugins tested: $TOTAL"
echo "Failed plugins: $FAILED"
if [[ $FAILED -gt 0 ]]; then
echo "❌ $FAILED plugin(s) failed action download tests"
exit 1
else
echo "✅ All $TOTAL plugin action download tests passed"
fi