Repository navigation
138 lines (118 loc) · 4.47 KB
/
Copy pathtest.yml
File metadata and controls
138 lines (118 loc) · 4.47 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Test Workflows
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
test-bundled-script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: '20'
# Both bundles matter: discover-components.cjs backs the discover/
# validate/generate actions, and opencode-release.cjs is run by the
# agentic-marketplace publish action. Only the first was checked here.
- name: Test bundled scripts exist, are executable, and parse
run: |
status=0
for f in scripts/dist/discover-components.cjs scripts/dist/opencode-release.cjs; do
if [ ! -f "$f" ]; then
echo "::error::bundled script not found: $f"; status=1; continue
fi
if [ ! -x "$f" ]; then
echo "::error::bundled script not executable: $f"; status=1; continue
fi
if ! node --check "$f"; then
echo "::error::bundled script is not valid JavaScript: $f"; status=1; continue
fi
echo "✓ $f exists, is executable, and parses"
done
exit $status
test-discover-action:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Test discover action
id: discover
uses: ./agentic-marketplace/discover
with:
config-path: 'test-fixtures/valid/.claude-plugin/generator.config.toml'
- name: Verify discovery output
run: |
echo "Components discovered:"
echo "${{ steps.discover.outputs.components }}" | head -20
test-validate-action:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Test validate action
uses: ./agentic-marketplace/validate
with:
config-path: 'test-fixtures/valid/.claude-plugin/generator.config.toml'
test-end-to-end:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: '20'
- name: Test discovery
working-directory: test-fixtures/valid
run: |
../../scripts/dist/discover-components.cjs discover-all > output.json
cat output.json
echo "✓ Discovery works"
- name: Test validation
working-directory: test-fixtures/valid
run: |
../../scripts/dist/discover-components.cjs validate
echo "✓ Validation works"
- name: Test generation
working-directory: test-fixtures/valid
run: |
../../scripts/dist/discover-components.cjs generate
if [ -f ".claude-plugin/marketplace.json" ]; then
echo "✓ marketplace.json generated"
cat .claude-plugin/marketplace.json
else
echo "ERROR: marketplace.json not generated"
exit 1
fi
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: '20'
- name: Install dependencies
run: npm ci
# `npm test` was not run by any workflow, so every unit test in
# scripts/test/ was passing locally and unenforced in CI.
- name: Run unit tests
run: npm test
# scripts/dist/*.cjs are committed artifacts consumed by the composite
# actions. Nothing checked that they match scripts/src/, so a source fix
# could be merged and never reach the action that runs it.
- name: Committed bundles match source
run: |
npm run build
if ! git diff --exit-code -- scripts/dist; then
echo "::error::scripts/dist is stale: run 'npm run build' and commit the result"
exit 1
fi
echo "✓ committed bundles are up to date with scripts/src"