forked from vibemafiaclub/vooster
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
114 lines (102 loc) · 3.89 KB
/
Copy pathaction.yml
File metadata and controls
114 lines (102 loc) · 3.89 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
name: Vooster Verify
description: Run vspec verify and map deterministic spec-code drift to a GitHub check.
inputs:
usecase-key:
description: Use case key to verify, for example UC-013.
required: true
test-command:
description: Optional delegated test command; Vooster uses only its exit code.
required: false
default: ""
api-url:
description: Optional Vooster API URL. Empty input falls back to local config or VSPEC_API_URL.
required: false
default: ""
session-cookie:
description: Optional vspec_session cookie. Empty input falls back to local config.
required: false
default: ""
working-directory:
description: Directory containing package.json, .vspec config, and implementation refs.
required: false
default: "."
unlinked-policy:
description: Use fail to fail on exit 7, or warn to surface incomplete coverage without failing.
required: false
default: fail
outputs:
exit_code:
description: Raw exit code returned by vspec verify.
value: ${{ steps.verify.outputs.exit_code }}
result_status:
description: passed, failed, or unlinked.
value: ${{ steps.verify.outputs.result_status }}
log_path:
description: Relative path to the captured verify log.
value: ${{ steps.verify.outputs.log_path }}
runs:
using: composite
steps:
- name: Install Vooster CLI dependencies
shell: bash
run: |
corepack enable
pnpm --dir "$GITHUB_ACTION_PATH" install --frozen-lockfile
- name: Run vspec verify
id: verify
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
VSPEC_VERIFY_USECASE: ${{ inputs.usecase-key }}
VSPEC_VERIFY_TEST_COMMAND: ${{ inputs.test-command }}
VSPEC_VERIFY_API_URL: ${{ inputs.api-url }}
VSPEC_VERIFY_SESSION_COOKIE: ${{ inputs.session-cookie }}
VSPEC_VERIFY_UNLINKED_POLICY: ${{ inputs.unlinked-policy }}
run: |
set +e
cmd=(node "$GITHUB_ACTION_PATH/apps/cli/bin/run.js" verify "$VSPEC_VERIFY_USECASE" --format=json --root "$PWD")
if [ -n "$VSPEC_VERIFY_TEST_COMMAND" ]; then
cmd+=(--test-cmd "$VSPEC_VERIFY_TEST_COMMAND")
fi
if [ -n "$VSPEC_VERIFY_API_URL" ]; then
cmd+=(--api-url "$VSPEC_VERIFY_API_URL")
fi
if [ -n "$VSPEC_VERIFY_SESSION_COOKIE" ]; then
cmd+=(--session-cookie "$VSPEC_VERIFY_SESSION_COOKIE")
fi
"${cmd[@]}" 2>&1 | tee vspec-verify.log
status="${PIPESTATUS[0]}"
result_status=failed
if [ "$status" -eq 0 ]; then
result_status=passed
elif [ "$status" -eq 7 ]; then
result_status=unlinked
fi
echo "exit_code=$status" >> "$GITHUB_OUTPUT"
echo "result_status=$result_status" >> "$GITHUB_OUTPUT"
echo "log_path=vspec-verify.log" >> "$GITHUB_OUTPUT"
{
echo "### Vooster verify"
echo
echo "- use case: $VSPEC_VERIFY_USECASE"
echo "- exit code: $status"
echo "- status: $result_status"
echo
echo '```text'
tail -n 120 vspec-verify.log
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
if [ "$status" -eq 0 ]; then
echo "::notice title=Vooster verify passed::All linked refs resolved and delegated tests passed or were not requested."
exit 0
fi
if [ "$status" -eq 7 ]; then
if [ "$VSPEC_VERIFY_UNLINKED_POLICY" = "warn" ]; then
echo "::warning title=Vooster verify incomplete coverage::One or more scenario steps have no implementation links."
exit 0
fi
echo "::error title=Vooster verify incomplete coverage::One or more scenario steps have no implementation links."
exit 7
fi
echo "::error title=Vooster verify failed::Broken implementation links or delegated test failures were found."
exit "$status"