Skip to content

Commit c6f862c

Browse files
authored
Remove cleanup step from setup-spiceio action (#4)
The action should ensure spiceio is running (starting it if needed) and leave it running for the rest of the job, rather than killing it on completion.
1 parent 9dc5609 commit c6f862c

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ outputs:
3535
endpoint:
3636
description: The S3-compatible endpoint URL
3737
value: ${{ steps.start.outputs.endpoint }}
38-
pid:
39-
description: PID of the spiceio background process (empty if skipped)
40-
value: ${{ steps.start.outputs.pid }}
4138

4239
runs:
4340
using: composite
@@ -70,7 +67,6 @@ runs:
7067
tar xzf "$ASSET" -C "$INSTALL_DIR"
7168
chmod +x "$INSTALL_DIR/spiceio"
7269
echo "$INSTALL_DIR" >> "$GITHUB_PATH"
73-
echo "pid_file=${RUNNER_TEMP}/spiceio.pid" >> "$GITHUB_OUTPUT"
7470
7571
- name: Start spiceio
7672
id: start
@@ -85,15 +81,11 @@ runs:
8581
set -euo pipefail
8682
8783
ENDPOINT="http://${SPICEIO_BIND}"
88-
PID_FILE="${{ steps.install.outputs.pid_file }}"
8984
9085
# Skip if spiceio is already listening on the requested address
91-
# Verify it's spiceio by checking for the "spiceio" server header
9286
if curl -sf -I "$ENDPOINT/" 2>/dev/null | grep -qi "server: spiceio"; then
9387
echo "spiceio already running at $ENDPOINT — skipping start"
9488
echo "endpoint=$ENDPOINT" >> "$GITHUB_OUTPUT"
95-
echo "pid=" >> "$GITHUB_OUTPUT"
96-
echo "skipped=true" >> "$GITHUB_OUTPUT"
9789
exit 0
9890
fi
9991
@@ -137,10 +129,7 @@ runs:
137129
138130
spiceio &
139131
PID=$!
140-
echo "$PID" > "$PID_FILE"
141-
echo "pid=$PID" >> "$GITHUB_OUTPUT"
142132
echo "endpoint=$ENDPOINT" >> "$GITHUB_OUTPUT"
143-
echo "skipped=false" >> "$GITHUB_OUTPUT"
144133
145134
# Wait for readiness
146135
echo "Waiting for spiceio on ${SPICEIO_BIND}..."
@@ -158,17 +147,3 @@ runs:
158147
echo "::error::spiceio failed to start within 30s"
159148
exit 1
160149
161-
- name: Register cleanup
162-
if: always() && steps.start.outputs.skipped != 'true'
163-
shell: bash
164-
run: |
165-
PID_FILE="${{ steps.install.outputs.pid_file }}"
166-
if [[ -f "$PID_FILE" ]]; then
167-
PID=$(cat "$PID_FILE")
168-
if kill -0 "$PID" 2>/dev/null; then
169-
echo "Stopping spiceio (PID $PID)"
170-
kill "$PID" 2>/dev/null || true
171-
wait "$PID" 2>/dev/null || true
172-
fi
173-
rm -f "$PID_FILE"
174-
fi

0 commit comments

Comments
 (0)