Skip to content

Commit db1375f

Browse files
committed
Add action
1 parent 8a3502e commit db1375f

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Verbose Probe
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
server:
7+
description: 'Server directory name (e.g. NginxServer, CaddyServer). Must match a folder under src/Servers/.'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
13+
probe:
14+
15+
name: Verbose Probe — ${{ inputs.server }}
16+
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Validate server
25+
run: |
26+
if [ ! -f "src/Servers/${{ inputs.server }}/probe.json" ]; then
27+
echo "::error::Server '${{ inputs.server }}' not found. Must match a directory under src/Servers/ containing probe.json."
28+
echo "Available servers:"
29+
ls src/Servers/
30+
exit 1
31+
fi
32+
echo "Server: $(jq -r .name "src/Servers/${{ inputs.server }}/probe.json")"
33+
34+
- name: Setup .NET
35+
uses: actions/setup-dotnet@v4
36+
with:
37+
dotnet-version: '10.0'
38+
39+
- name: Build probe CLI
40+
run: dotnet build Http11Probe.slnx -c Release
41+
42+
- name: Build Docker image
43+
run: |
44+
tag=$(echo "probe-${{ inputs.server }}" | tr '[:upper:]' '[:lower:]')
45+
docker build -t "$tag" -f "src/Servers/${{ inputs.server }}/Dockerfile" .
46+
47+
- name: Start server
48+
run: |
49+
tag=$(echo "probe-${{ inputs.server }}" | tr '[:upper:]' '[:lower:]')
50+
docker run -d --name probe-target --network host "$tag"
51+
52+
- name: Wait for server
53+
run: |
54+
for i in $(seq 1 30); do
55+
curl -sf "http://localhost:8080/" > /dev/null 2>&1 && break
56+
sleep 1
57+
done
58+
59+
- name: Run probe (verbose)
60+
run: |
61+
dotnet run --no-build -c Release --project src/Http11Probe.Cli -- \
62+
--host localhost --port 8080 --verbose
63+
64+
- name: Cleanup
65+
if: always()
66+
run: docker rm -f probe-target 2>/dev/null || true

0 commit comments

Comments
 (0)