Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.

Commit 1e54363

Browse files
add preflight test and test context support (#36)
* feat: add preflight test run before other test suites * feat: add test context support * update package-lock.json * chore: format code with prettier Co-Authored-By: jinfengLoggia <jinfeng@loggia.ai>
1 parent d2a5cd4 commit 1e54363

12 files changed

Lines changed: 2458 additions & 1898 deletions

File tree

‎.env.example‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,33 @@ INPUT_MILLISECONDS=2400
5959
# RUNNER_OS=""
6060
# RUNNER_TEMP=""
6161
# RUNNER_TOOL_CACHE=""
62+
63+
64+
# =========================
65+
# GitHub Action local debug
66+
# =========================
67+
68+
# Required inputs
69+
INPUT_API-TOKEN=your_shiplight_api_token_here
70+
INPUT_TEST-SUITE-ID=101,102,103
71+
INPUT_ENVIRONMENT-ID=12
72+
73+
# Optional inputs
74+
INPUT_ENVIRONMENT-URL=https://staging.example.com
75+
INPUT_PREFLIGHT-TEST-CASE-ID=9001
76+
INPUT_ASYNC=false
77+
INPUT_TIMEOUT-SECONDS=1800
78+
INPUT_GITHUB-COMMENT=false
79+
INPUT_GITHUB-TOKEN=ghp_xxx_if_you_need_pr_comment
80+
INPUT_COMMIT-SHA=
81+
82+
# Optional API/APP endpoint overrides (for dev/staging)
83+
SHIPLIGHT_API_URL=https://api.shiplight.ai
84+
SHIPLIGHT_APP_URL=https://app.shiplight.ai
85+
86+
# GitHub context for local PR metadata mocking
87+
GITHUB_EVENT_NAME=pull_request
88+
GITHUB_EVENT_PATH=__fixtures__/mock-event-pull-request.json
89+
GITHUB_REPOSITORY=jinfengLoggia/cicd-demo
90+
GITHUB_REF=refs/pull/1/merge
91+
GITHUB_SHA=96cd365d0fc7db2574121ce94195dfb2b032c393
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"pull_request": {
3+
"number": 1,
4+
"title": "feat: improve checkout flow"
5+
},
6+
"head_commit": {
7+
"id": "96cd365d0fc7db2574121ce94195dfb2b032c393",
8+
"message": "fix: stabilize login step\n\nretry selector with timeout"
9+
}
10+
}

‎action.yml‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@ name: shiplight-runner
22
description: Use This GitHub Action to run tests on https://app.shiplight.ai
33
author: Shiplight AI
44

5-
# Add your action's branding here. This will appear on the GitHub Marketplace.
65
branding:
76
icon: 'cloud-lightning'
87
color: 'blue'
98

10-
# Define your inputs here.
119
inputs:
1210
api-token:
1311
description: api token for shiplight
1412
required: true
1513
test-suite-id:
1614
description:
17-
test suite ID (single ID or comma-separated list, e.g., "suite1" or
18-
"suite1,suite2,suite3")
15+
test suite ID (single ID or comma-separated list, e.g., "1" or "1,2,3")
1916
required: true
17+
preflight-test-case-id:
18+
description:
19+
optional preflight test case ID. If set, the preflight test runs before
20+
main test suites
21+
required: false
2022
environment-id:
2123
description: environment id
2224
required: true
@@ -43,13 +45,27 @@ inputs:
4345
description: 'Maximum time to wait for test runs to complete (in seconds)'
4446
required: false
4547
default: '86400'
48+
test-context:
49+
description: |
50+
Test context key-value pairs to pass to the test run, one per line in KEY=VALUE format.
51+
Example:
52+
env=staging
53+
feature-flag=enabled
54+
required: false
4655

47-
# Define your outputs here.
4856
outputs:
4957
success:
5058
description: Whether all test runs were successful
5159
results:
5260
description: JSON string containing results for each test suite
61+
run-id:
62+
description: Shiplight run ID
63+
run-url:
64+
description: Shiplight run result URL
65+
preflight-result:
66+
description: Preflight result (Passed|Failed|Skipped|Pending)
67+
metadata:
68+
description: Trigger metadata JSON string
5369

5470
runs:
5571
using: node20

0 commit comments

Comments
 (0)