Skip to content

Commit e8ea009

Browse files
committed
fix: better debug/wait steps
Signed-off-by: Sam Gammon <[email protected]>
1 parent 1b29d95 commit e8ea009

File tree

6 files changed

+53
-7
lines changed

6 files changed

+53
-7
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ jobs:
158158
runs-on: ubuntu-latest
159159
env:
160160
ACTIONS_STEP_DEBUG: 'true'
161+
ACTIONS_RUNNER_DEBUG: 'true'
161162
steps:
162163
- name: Harden Runner
163164
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
@@ -174,7 +175,43 @@ jobs:
174175

175176
- name: "Test: Print Output"
176177
id: output
177-
run: echo "${{ steps.test-action.outputs.path }}"
178+
run: |
179+
echo "Binary path:"
180+
echo "${{ steps.test-action.outputs.path }}"
181+
echo ""
182+
echo "Agent status:"
183+
buildless agent status || $(echo "Failed to check agent status" && exit 1)
184+
echo ""
185+
echo "Agent output:"
186+
cat /var/tmp/buildless-agent.out || $(echo "Failed to read agent output" && exit 1)
187+
188+
test-debug-noagent:
189+
name: "Test: Basic (No Agent)"
190+
runs-on: ubuntu-latest
191+
env:
192+
ACTIONS_STEP_DEBUG: 'true'
193+
ACTIONS_RUNNER_DEBUG: 'true'
194+
steps:
195+
- name: Harden Runner
196+
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
197+
with:
198+
egress-policy: audit
199+
200+
- name: "Setup: Checkout"
201+
id: checkout
202+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
203+
204+
- name: "Test: Buildless Action"
205+
id: test-action
206+
uses: ./
207+
with:
208+
agent: false
209+
210+
- name: "Test: Print Output"
211+
id: output
212+
run: |
213+
echo "Binary path:"
214+
echo "${{ steps.test-action.outputs.path }}"
178215
179216
test-no-token:
180217
name: "Test: No Token"
@@ -432,7 +469,15 @@ jobs:
432469

433470
- name: "Test: Print Output"
434471
id: output
435-
run: echo "${{ steps.test-action.outputs.path }}"
472+
run: |
473+
echo "Binary path:"
474+
echo "${{ steps.test-action.outputs.path }}"
475+
echo ""
476+
echo "Agent status:"
477+
buildless agent status || $(echo "Failed to check agent status" && exit 1)
478+
echo ""
479+
echo "Agent output:"
480+
cat /var/tmp/buildless-agent.out || $(echo "Failed to read agent output" && exit 1)
436481
437482
- name: "Test: Agent Running"
438483
run: |

dist/cleanup/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cleanup/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/command.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ async function spawnDirect(): Promise<number> {
299299
`Agent spawn completed but reported failure. Please see logs in debug mode.`
300300
)
301301
}
302+
await wait(500) // give the agent time to start up
302303
return spawnedAgent.pid
303304
} catch (err) {
304305
await sendError(err)
@@ -311,7 +312,7 @@ async function spawnViaCli(): Promise<number> {
311312
core.debug('Starting Buildless Agent via CLI')
312313
const started = await execBuildless(BuildlessCommand.AGENT_START)
313314
if (started.exitCode === 0) {
314-
await wait(2000) // give the agent time to start up
315+
await wait(500) // give the agent time to start up
315316

316317
// then resolve config
317318
const config = await agentConfig()

0 commit comments

Comments
 (0)