Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for comment report #35

Merged
merged 3 commits into from
Jul 1, 2024
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
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
cache: pnpm
- run: |
yarn install
yarn all
pnpm install
pnpm run all
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ See [action.yml](action.yml)
| - | - | - | - |
| `json-path` | Path to RSpec result json file. (Support for glob pattern) | | yes |
| `token` | GITHUB_TOKEN | `${{ github.token }}` | no |
| `title` | Summary title | `# :cold_sweat: RSpec failure` | no |
| `hideFooterLink` | Hide footer link | `false` | no |
| `comment` | Set this if want to comment report to pull request | `true` | no |

## Example

Expand All @@ -33,7 +36,7 @@ jobs:
run: bundle exec rspec -f j -o tmp/rspec_results.json -f p

- name: RSpec Report
uses: SonicGarden/rspec-report-action@v4
uses: SonicGarden/rspec-report-action@v5
with:
json-path: tmp/rspec_results.json
if: always()
Expand Down Expand Up @@ -93,7 +96,7 @@ jobs:
path: /tmp/json-reports
merge-multiple: true
- name: RSpec Report
uses: SonicGarden/rspec-report-action@v4
uses: SonicGarden/rspec-report-action@v5
with:
json-path: /tmp/json-reports/rspec_results-*.json
```
4 changes: 3 additions & 1 deletion __tests__/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import {parse} from '../src/parse'
import {expect, test} from '@jest/globals'

test('Parse rspec result json', async () => {
const result = parse([path.resolve(__dirname, '../.dummy_results-0.json')])
const result = await parse([
path.resolve(__dirname, '../.dummy_results-0.json')
])
expect(result).toEqual({
summary: '25 examples, 1 failure',
examples: [
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
description: "Hide footer link"
default: "false"
required: false
comment:
description: "Set this if want to comment report to pull request"
default: "true"
required: false
runs:
using: "node20"
main: "dist/index.js"
Loading