-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathaction.yml
More file actions
83 lines (75 loc) · 2.37 KB
/
Copy pathaction.yml
File metadata and controls
83 lines (75 loc) · 2.37 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
name: 'Bruno CLI'
description: 'Run Bruno CLI commands in GitHub Actions — collection runs, environment-based testing, and any bru subcommand.'
author: 'Bruno'
branding:
icon: 'terminal'
color: 'yellow'
inputs:
command:
description: 'The bru subcommand and flags (e.g. "run --env prod --reporter-junit results.xml"). The action prepends "bru".'
required: true
bru-version:
description: 'Version of @usebruno/cli to install.'
required: false
default: 'latest'
working-directory:
description: 'Shell working directory. Typically the Bruno collection root.'
required: false
default: '.'
outputs:
exit-code:
description: 'Exit code from the bru process.'
value: ${{ steps.run.outputs.exit-code }}
passed:
description: 'Number of passed requests.'
value: ${{ steps.report.outputs.passed }}
failed:
description: 'Number of failed requests.'
value: ${{ steps.report.outputs.failed }}
total:
description: 'Total requests run.'
value: ${{ steps.report.outputs.total }}
duration-ms:
description: 'Sum of testsuite durations in milliseconds.'
value: ${{ steps.report.outputs.duration-ms }}
runs:
using: 'composite'
steps:
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Install action dependencies (fast-xml-parser)
shell: bash
run: |
cd "${{ github.action_path }}"
npm ci --omit=dev --no-audit --no-fund --prefer-offline
- name: Install Bruno CLI
shell: bash
env:
BRU_VERSION: ${{ inputs.bru-version }}
run: ${{ github.action_path }}/lib/install-cli.sh
- name: Run bru
id: run
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
USER_COMMAND: ${{ inputs.command }}
run: ${{ github.action_path }}/lib/run-bru.sh
- name: Parse JUnit results
id: report
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
JUNIT_PATH: ${{ steps.run.outputs.junit-path }}
run: node ${{ github.action_path }}/lib/report.js
- name: Propagate exit code
shell: bash
env:
RUN_EXIT: ${{ steps.run.outputs.exit-code }}
run: |
set -euo pipefail
if [ "${RUN_EXIT:-0}" -ne 0 ]; then
echo "::error::bru exited with ${RUN_EXIT}."
exit "${RUN_EXIT}"
fi