-
Notifications
You must be signed in to change notification settings - Fork 78
174 lines (142 loc) · 4.99 KB
/
Copy pathtest.yml
File metadata and controls
174 lines (142 loc) · 4.99 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: Test
on:
pull_request:
push:
branches:
- main
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '18'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.1
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check formatting
run: pnpm run format:check
- name: Type check
run: pnpm run type-check
- name: Build
run: pnpm run build
- name: Run tests
run: pnpm run test
test-binary:
if: github.event_name == 'pull_request'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: bun-linux-x64
binary: firecrawl-linux-x64
- os: macos-latest
target: bun-darwin-arm64
binary: firecrawl-darwin-arm64
- os: windows-latest
target: bun-windows-x64
binary: firecrawl-windows-x64.exe
runs-on: ${{ matrix.os }}
name: Binary test (${{ matrix.os }})
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Compile binary
run: bun build src/index.ts --compile --target=${{ matrix.target }} --outfile ${{ matrix.binary }}
- name: Verify binary runs (Unix)
if: runner.os != 'Windows'
run: |
chmod +x ${{ matrix.binary }}
./${{ matrix.binary }} --version
./${{ matrix.binary }} --help
- name: Verify binary runs (Windows)
if: runner.os == 'Windows'
run: |
.\${{ matrix.binary }} --version
.\${{ matrix.binary }} --help
test-npm-package:
if: github.event_name == 'pull_request'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
name: npm package smoke test (${{ matrix.os }}, Node 24)
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.12.1
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Pack npm package
run: npm pack
- name: Verify npx subcommands (Unix)
if: runner.os != 'Windows'
run: |
PACKAGE=$(ls firecrawl-cli-*.tgz | head -n 1)
if [ -z "$PACKAGE" ]; then
echo "Packed package not found"
exit 1
fi
PACKAGE_PATH="$PWD/$PACKAGE"
npx -y --package "$PACKAGE_PATH" firecrawl --version
npx -y --package "$PACKAGE_PATH" firecrawl version
npx -y --package "$PACKAGE_PATH" firecrawl login --help
npx -y --package "$PACKAGE_PATH" firecrawl setup --help
npx -y --package "$PACKAGE_PATH" firecrawl help setup
- name: Verify npx subcommands (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$Package = Get-ChildItem .\firecrawl-cli-*.tgz | Select-Object -First 1
if (-not $Package) {
throw "Packed package not found"
}
npx -y --package $($Package.FullName) firecrawl --version
npx -y --package $($Package.FullName) firecrawl version
npx -y --package $($Package.FullName) firecrawl login --help
npx -y --package $($Package.FullName) firecrawl setup --help
npx -y --package $($Package.FullName) firecrawl help setup
- name: Verify secure MCP setup through Windows npx.cmd
if: runner.os == 'Windows'
shell: pwsh
run: |
$Package = Get-ChildItem .\firecrawl-cli-*.tgz | Select-Object -First 1
$TempHome = Join-Path $env:RUNNER_TEMP "firecrawl-mcp-home"
New-Item -ItemType Directory -Force -Path $TempHome | Out-Null
$env:HOME = $TempHome
$env:USERPROFILE = $TempHome
$env:FIRECRAWL_API_KEY = "fc-windows-smoke-secret"
npx -y --package $($Package.FullName) firecrawl setup mcp --agent claude-code --global --yes
$ConfigPath = Join-Path $TempHome ".claude.json"
if (-not (Test-Path $ConfigPath)) {
throw "Claude Code MCP config was not created"
}
$Config = Get-Content $ConfigPath -Raw
if ($Config.Contains("fc-windows-smoke-secret")) {
throw "MCP setup persisted the raw environment-backed API key"
}
if (-not $Config.Contains('${FIRECRAWL_API_KEY}')) {
throw "MCP setup did not preserve Claude Code environment expansion"
}