-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (46 loc) · 1.62 KB
/
test-action.yml
File metadata and controls
54 lines (46 loc) · 1.62 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
name: Test GitHub Action
on:
pull_request:
paths:
- 'packages/github-action/**'
push:
branches: [main]
paths:
- 'packages/github-action/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- name: Validate action schema
run: bun test packages/github-action
- name: Verify action.yml is parseable
run: |
python3 -c "
import yaml, sys
with open('packages/github-action/action.yml') as f:
action = yaml.safe_load(f)
assert action['runs']['using'] == 'composite', 'Not a composite action'
assert 'api-key' in action['inputs'], 'Missing api-key input'
assert 'sandbox-id' in action['outputs'], 'Missing sandbox-id output'
assert 'replay-url' in action['outputs'], 'Missing replay-url output'
print('Action schema valid')
"
- name: Verify cleanup action is parseable
run: |
python3 -c "
import yaml, sys
with open('packages/github-action/cleanup/action.yml') as f:
action = yaml.safe_load(f)
assert action['runs']['using'] == 'composite', 'Not a composite action'
assert 'sandbox-id' in action['inputs'], 'Missing sandbox-id input'
assert 'api-key' in action['inputs'], 'Missing api-key input'
print('Cleanup action schema valid')
"