-
-
Notifications
You must be signed in to change notification settings - Fork 64
64 lines (53 loc) · 1.45 KB
/
test-windows.yml
File metadata and controls
64 lines (53 loc) · 1.45 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
name: Windows Tests
on:
workflow_dispatch:
push:
branches: ["**"]
paths:
- "src/**"
- "tests/**"
- ".github/workflows/test-windows.yml"
pull_request:
branches: [main]
paths:
- "src/**"
- "tests/**"
- ".github/workflows/test-windows.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-windows:
name: Windows Tests
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
env:
BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/cli"
- name: Build
run: bun run build
- name: Run tests
run: bun test
env:
AGENT: "1"
- name: Test rm -rf within cwd
run: |
# Create test directory structure
mkdir test-dir
# Test: rm -rf dist should be ALLOWED within cwd
$result = bun run cc-safety-net explain --cwd test-dir "rm -rf dist" 2>&1
Write-Host "Result: $result"
if ($result -match "ALLOWED") {
Write-Host "✅ PASS: rm -rf dist within cwd is correctly ALLOWED"
} else {
Write-Host "❌ FAIL: rm -rf dist within cwd should be ALLOWED but was blocked"
exit 1
}
shell: pwsh