Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5c264c4
fix: error messages
Ma11hewThomas Mar 31, 2025
62e5724
chore: debug
Ma11hewThomas Mar 31, 2025
2167767
fix: ensure proper group termination on permission errors in GitHub c…
Ma11hewThomas Mar 31, 2025
16e2eac
fix: improve error message formatting for GitHub permissions issues
Ma11hewThomas Mar 31, 2025
bedfdd3
chore: add write permissions for issues in GitHub Actions workflow
Ma11hewThomas Mar 31, 2025
e330402
chore: add write permissions for pull requests in GitHub Actions work…
Ma11hewThomas Mar 31, 2025
0747bc6
chore: remove write permissions for issues and pull requests in GitHu…
Ma11hewThomas Mar 31, 2025
468eff1
chore: update dependencies and improve GitHub client with retry funct…
Ma11hewThomas Mar 31, 2025
7c727ea
docs: update npx usage warning in documentation to reflect lack of su…
Ma11hewThomas Apr 1, 2025
15848cd
feat: add report-order input for custom report display order
Ma11hewThomas Apr 1, 2025
f0d7f6f
fix: update report-order in GitHub Actions workflow to remove summary…
Ma11hewThomas Apr 1, 2025
808a4c1
feat: implement custom report order logic
Ma11hewThomas Apr 1, 2025
f0f7932
fix: update report-order in GitHub Actions workflow to include summar…
Ma11hewThomas Apr 1, 2025
e24242f
chore: update binary files and remove default report order logging
Ma11hewThomas Apr 1, 2025
dffc999
docs: update README to include new status checks section and clarify …
Ma11hewThomas Apr 1, 2025
bf40814
chore: remove report-order from GitHub Actions workflow configuration
Ma11hewThomas Apr 1, 2025
e11afc0
Merge branch 'main' of https://github.com/ctrf-io/github-test-reporte…
Ma11hewThomas Apr 5, 2025
9c3d0e5
chore: update coverage badge and binary map file
Ma11hewThomas Apr 5, 2025
39d0949
docs: add customization section for report order in README and remove…
Ma11hewThomas Apr 5, 2025
8a0145e
docs: update README to reflect new report order customization section…
Ma11hewThomas Apr 5, 2025
9ad48b4
feat: add report-order-test job to GitHub Actions workflow for custom…
Ma11hewThomas Apr 5, 2025
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
22 changes: 22 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,28 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always()
report-order-test:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Modify reports
run: npm run modify-reports
- name: Custom Report Order
uses: ./
with:
report-path: './ctrf-reports/*.json'
summary-report: true
failed-report: true
flaky-report: true
report-order: 'flaky-report,failed-report,summary-report'
annotate: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always()
junit-to-ctrf-test:
needs: build-and-test
runs-on: ubuntu-latest
Expand Down
66 changes: 55 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,18 @@ Checkout all the built-in reports [here](docs/report-showcase.md)
1. [Usage](#usage)
2. [Available Inputs](#available-inputs)
3. [Pull Requests](#pull-requests)
4. [Build Your Own Report](#build-your-own-report)
5. [Community Reports](#community-reports)
6. [GitHub Token](#github-token)
7. [Storing Artifacts](#storing-artifacts)
8. [Filtering](#filtering)
9. [Integrations](#integrations)
10. [Generating an AI Report](#generating-an-ai-report)
11. [Run With NPX](#run-with-npx)
12. [Report Showcase](#report-showcase)
13. [What is CTRF?](#what-is-ctrf)
4. [Status Checks](#status-checks)
5. [Build Your Own Report](#build-your-own-report)
6. [Customizing Report Order](#customizing-report-order)
7. [Community Reports](#community-reports)
8. [GitHub Token](#github-token)
9. [Storing Artifacts](#storing-artifacts)
10. [Filtering](#filtering)
11. [Integrations](#integrations)
12. [Generating an AI Report](#generating-an-ai-report)
13. [Run With NPX](#run-with-npx)
14. [Report Showcase](#report-showcase)
15. [What is CTRF?](#what-is-ctrf)

## Usage

Expand Down Expand Up @@ -168,6 +170,7 @@ There are several inputs available
fetch-previous-results: false # Always fetch previous workflow runs when using custom templates. Default is false
group-by: 'filePath' # Specify grouping for applicable reports (e.g., suite or file path). Default is filePath
always-group-by: false # Force grouping by suite or file path for all reports. Default is false
report-order: 'summary-report,failed-report,flaky-report,skipped-report,test-report' # Comma-separated list of report types to specify the order in which reports should be displayed
integrations-config: '{}' # JSON configuration for integrations with other developer tools
if: always()
```
Expand Down Expand Up @@ -209,6 +212,10 @@ Additionally, you can add any report to a pull request comment by adding the

The `pull-request` input works with all reports, including custom.

requires a `GITHUB_TOKEN` with pull request write permission.

**Note:** Special considerations apply to pull requests from forks. See [Fork Pull Requests](docs/fork-pull-requests.md) for details.

You can also comment on a specific issue or pull request by using the `issue`
input and providing the issue number ():

Expand All @@ -223,7 +230,7 @@ input and providing the issue number ():
if: always()
```

**Note:** Special considerations apply to pull requests from forks. See [Fork Pull Requests](docs/fork-pull-requests.md) for details.
Requires a `GITHUB_TOKEN` with issue or pull request write permission.

### Comment Management Inputs

Expand Down Expand Up @@ -253,6 +260,22 @@ current workflow and job names:
if: always()
```

## Status Checks

The `status-check` input creates a status check for the workflow.

```yaml
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: './ctrf/*.json'
status-check: true
status-check-name: 'GitHub Test Reporter Results'
if: always()
```

Requires a `GITHUB_TOKEN` with status check write permission.

## Build Your Own Report

The `custom-report` input lets you build your own report using a Handlebars
Expand Down Expand Up @@ -299,6 +322,27 @@ Add the following to your workflow file:
if: always()
```

## Customizing Report Order

The GitHub Test Reporter allows you to customize the order in which reports appear in your job summary or pull request comments. This feature gives you complete control over how your test results are presented. To customize the order of reports, use the `report-order` parameter with a comma-separated list of report types:

```yaml
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: './ctrf/*.json'
summary-report: true
failed-report: true
flaky-report: true
insights-report: true
test-report: true
# Order reports with the most important information first
report-order: 'summary-report,failed-report,flaky-report,insights-report,test-report'
if: always()
```

If report-order is not provided, a default order is used.

## GitHub Token

`previous-results-report`, `insights-report`, `flaky-rate-report`, `fail-rate-report`, and `slowest-report` need a
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ inputs:
behavior
required: false
default: false
report-order:
description: >
Comma-separated list of report types to specify the order in which reports
should be displayed in the summary.
required: false
default: ''

# Integration Configuration
integrations-config:
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading