Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,23 @@ fi

echo "$DEBUG $PROFILE_NAME $VARIABLES"

tmp_output=$(mktemp)

bugbug config set-token $API_TOKEN
bugbug remote run $run_context $related_id --no-progress "${extra_args[@]}" --reporter=junit
bugbug remote run $run_context $related_id --no-progress "${extra_args[@]}" --reporter=junit | tee $tmp_output
bugbug_status=${PIPESTATUS[0]}

# Setting output suiteRunId or testRunId
while IFS= read -r line; do
if [[ $line =~ suiteRunId:\ ([a-z0-9-]+) ]]; then
SUITE_RUN_ID="${BASH_REMATCH[1]}"
echo "Setting output suiteRunId = $SUITE_RUN_ID"
echo "suiteRunId=${SUITE_RUN_ID}" >> $GITHUB_OUTPUT
elif [[ $line =~ testRunId:\ ([a-z0-9-]+) ]]; then
TEST_RUN_ID="${BASH_REMATCH[1]}"
echo "Setting output testRunId = $TEST_RUN_ID"
echo "testRunId=${TEST_RUN_ID}" >> $GITHUB_OUTPUT
fi
done < $tmp_output

exit $bugbug_status
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
</p>

## BugBug Cloud Runner

Official GitHub action to run tests and suites on BugBug Cloud.

> [!IMPORTANT]
Expand Down Expand Up @@ -42,6 +43,16 @@ Official GitHub action to run tests and suites on BugBug Cloud.
- **Required**: No
- **Default**: `test-results.xml`

### Outputs

`suiteRunId`

- **Description**: The Run ID when executing passing a suiteId.

`testRunId`

- **Description**: The Run ID when executing passing a testId.

### Example Usage

```yaml
Expand All @@ -56,6 +67,7 @@ jobs:
uses: actions/checkout@v4

- name: Run BugBug Cloud Runner
id: run-bugbug-tests
uses: bugbug-io/bugbug-github-action@v1.0.2
with:
apiToken: ${{ secrets.BUGBUG_API_TOKEN }}
Expand All @@ -64,4 +76,9 @@ jobs:
profileName: "Your BugBug profile name"
variables: "key1=value1,key2=value2"
debug: "true"

- name: Getting Run Output
run: |
echo "Suite Run ID: ${{ steps.run-bugbug-tests.outputs.suiteRunId }}"
echo "Test Run ID: ${{ steps.run-bugbug-tests.outputs.testRunId }}"
```
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ inputs:
description: "Show more data (like raw API response)."
required: false
default: "false"
outputs:
suiteRunId:
description: "The Run ID when executing passing a suiteId."
value: ${{ steps.run-on-bugbug.outputs.suiteRunId }}
testRunId:
description: "The Run ID when executing passing a testId."
value: ${{ steps.run-on-bugbug.outputs.testRunId }}
runs:
using: "composite"
steps:
Expand All @@ -48,6 +55,7 @@ runs:
run: npm i -g @testrevolution/bugbug-cli@${{ inputs.version }}

- name: "Run on BugBug"
id: run-on-bugbug
shell: bash
run: ${{ github.action_path }}/.github/scripts/run.sh
env:
Expand Down