Skip to content

Commit

Permalink
Merge pull request #298 from dorny/main
Browse files Browse the repository at this point in the history
Merge v1.7.0 to v1 branche
  • Loading branch information
j-catania authored Oct 9, 2023
2 parents e9fa2f5 + 214173a commit 1e3a380
Show file tree
Hide file tree
Showing 19 changed files with 2,675 additions and 6,600 deletions.
25 changes: 2 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"import/no-named-as-default": "off",
"no-shadow": "off",
"no-unused-vars": "off",
"prefer-template": "off",
Expand Down Expand Up @@ -60,29 +61,7 @@
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`

// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default

// use <root>/path/to/folder/tsconfig.json
"project": "path/to/folder",

// Multiple tsconfigs (Useful for monorepos)

// use a glob pattern
"project": "packages/*/tsconfig.json",

// use an array
"project": [
"packages/module-a/tsconfig.json",
"packages/module-b/tsconfig.json"
],

// use an array of glob patterns
"project": [
"packages/*/tsconfig.json",
"other-packages/*/tsconfig.json"
]
"alwaysTryTypes": true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
6 changes: 3 additions & 3 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set Node.js 16.x
uses: actions/setup-node@v3.5.1
uses: actions/setup-node@v3
with:
node-version: 16.x

Expand All @@ -46,7 +46,7 @@ jobs:
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: node --version
- run: npm ci
- run: npm run build
Expand All @@ -23,7 +23,7 @@ jobs:

- name: Upload test results
if: success() || failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: test-results
path: __tests__/__results__/*.xml
2 changes: 1 addition & 1 deletion .github/workflows/manual-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- run: npm ci
- run: npm run build
- run: npm test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Workflow test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ./
with:
artifact: test-results
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 1.7.0
* Fix #199: Use ✅ instead of ✔️ for better cross platform look by @petrdvorak in https://github.com/dorny/test-reporter/pull/200
* Verify content of dist/ folder matches build output by @dorny in https://github.com/dorny/test-reporter/pull/207
* Gracefully handle empty nested testsuite elements for JUnit. by @rvdlaarschot in https://github.com/dorny/test-reporter/pull/193
* Gracefully handle empty failure tags by @haudren-woven in https://github.com/dorny/test-reporter/pull/213
* Fix #208 - java-junit: show annotations on PR changed files by @atsu85 in https://github.com/dorny/test-reporter/pull/209
* Only report failure if fail-on-error is set by @trond-snekvik in https://github.com/dorny/test-reporter/pull/214
* Improve clarity on configuring for forkable repos by @abelbraaksma in https://github.com/dorny/test-reporter/pull/211
* Suppress "Processing test results from" log by @vasanthdharmaraj in https://github.com/dorny/test-reporter/pull/179
* Skip listing of files if error parsing is disabled by @dorny in https://github.com/dorny/test-reporter/pull/216
* Correct typo in docs by @tangowithfoxtrot in https://github.com/dorny/test-reporter/pull/254
* update dependencies by @j-catania in https://github.com/dorny/test-reporter/pull/269
* Add permissions to example yml files by @TurnrDev in https://github.com/dorny/test-reporter/pull/263
* add feature fail-on-empty by @gdams in https://github.com/dorny/test-reporter/pull/243
* Add dependabot configuration by @yeikel in https://github.com/dorny/test-reporter/pull/228
* Bump ws from 7.3.1 to 7.5.9 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/265
* Bump actions/checkout from 2 to 4 by @dependabot in https://github.com/dorny/test-reporter/pull/279
* Add new output for url url html by @luisito666 in https://github.com/dorny/test-reporter/pull/242
* Update README.md by @IanMoroney in https://github.com/dorny/test-reporter/pull/158
* Update jest-Junit part of Readme by @ryancasburn-KAI in https://github.com/dorny/test-reporter/pull/176
* fix: default-valued fields are not mandatory by @TomerFi in https://github.com/dorny/test-reporter/pull/172
* Bump ansi-regex from 4.1.0 to 4.1.1 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/278
* Bump decode-uri-component from 0.2.0 to 0.2.2 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/276
* Bump minimist from 1.2.5 to 1.2.8 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/275
* Bump qs from 6.5.2 to 6.5.3 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/272
* Bump json5 from 2.1.3 to 2.2.3 in /reports/jest by @dependabot in https://github.com/dorny/test-reporter/pull/271
* Bump ansi-regex from 3.0.0 to 3.0.1 in /reports/mocha by @dependabot in https://github.com/dorny/test-reporter/pull/270
* declare 'url' and 'url_html' as action outputs by @micha-one in https://github.com/dorny/test-reporter/pull/287
* Avoid split on undefined by @cazou in https://github.com/dorny/test-reporter/pull/258

## v1.6.0
- [Update to node16 + recent versions of core and exec packages](https://github.com/dorny/test-reporter/pull/203)
- [Update all dependencies to latest versions](https://github.com/dorny/test-reporter/pull/186)
Expand Down
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ If that's fine for you, using this action is as simple as:
on:
pull_request:
push:
permissions:
contents: read
actions: read
checks: write
jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # checkout the repo
- uses: actions/checkout@v3 # checkout the repo
- run: npm ci # install packages
- run: npm test # run tests (configured to use jest-junit reporter)

Expand Down Expand Up @@ -69,10 +73,10 @@ jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2 # checkout the repo
- uses: actions/checkout@v3 # checkout the repo
- run: npm ci # install packages
- run: npm test # run tests (configured to use jest-junit reporter)
- uses: actions/upload-artifact@v2 # upload test results
- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
Expand All @@ -86,6 +90,10 @@ on:
workflows: ['CI'] # runs after CI workflow
types:
- completed
permissions:
contents: read
actions: read
checks: write
jobs:
report:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -116,7 +124,7 @@ jobs:
# Name of the Check Run which will be created
name: ''
# Coma separated list of paths to test results
# Comma-separated list of paths to test results
# Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob)
# All matched result files must be of the same format
path: ''
Expand Down Expand Up @@ -158,6 +166,9 @@ jobs:
# Set action as failed if test report contains any failed test
fail-on-error: 'true'
# Set this action as failed if no test results were found
fail-on-empty: 'true'
# Relative path under $GITHUB_WORKSPACE where the repository was checked out.
working-directory: ''
Expand All @@ -174,6 +185,8 @@ jobs:
| failed | Count of failed tests |
| skipped | Count of skipped tests |
| time | Test execution time [ms] |
| url | Check run URL |
| url_html | Check run URL HTML |

## Supported formats

Expand Down Expand Up @@ -258,14 +271,14 @@ Some heuristic was necessary to figure out the mapping between the line in the s
</details>

<details>
<summary>jest-Junit</summary>
<summary>jest-junit</summary>

[JEST](https://jestjs.io/) testing framework support requires the usage of [jest-Junit](https://github.com/jest-community/jest-Junit) reporter.
[JEST](https://jestjs.io/) testing framework support requires the usage of [jest-junit](https://github.com/jest-community/jest-junit) reporter.
It will create test results in Junit XML format which can be then processed by this action.
You can use the following example configuration in `package.json`:
```json
"scripts": {
"test": "jest --ci --reporters=default --reporters=jest-Junit"
"test": "jest --ci --reporters=default --reporters=jest-junit"
},
"devDependencies": {
"jest": "^26.5.3",
Expand Down Expand Up @@ -310,7 +323,7 @@ Unfortunately, there are some known issues and limitations caused by GitHub API:

- Test report (i.e. Check Run summary) is markdown text. No custom styling or HTML is possible.
- Maximum report size is 65535 bytes. Input parameters `list-suites` and `list-tests` will be automatically adjusted if max size is exceeded.
- Test report can't reference any additional files (e.g. screenshots). You can use `actions/upload-artifact@v2` to upload them and inspect them manually.
- Test report can't reference any additional files (e.g. screenshots). You can use `actions/upload-artifact@v3` to upload them and inspect them manually.
- Check Runs are created for specific commit SHA. It's not possible to specify under which workflow test report should belong if more
workflows are running for the same SHA. Thanks to this GitHub "feature" it's possible your test report will appear in an unexpected place in GitHub UI.
For more information, see [#67](https://github.com/dorny/test-reporter/issues/67).
Expand Down
16 changes: 12 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ inputs:
required: true
path:
description: |
Coma separated list of paths to test results
Comma-separated list of paths to test results
Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob)
All matched result files must be of same format
required: true
Expand All @@ -37,24 +37,28 @@ inputs:
Limits which test suites are listed. Supported options:
- all
- only-failed
required: true
required: false
default: 'all'
list-tests:
description: |
Limits which test cases are listed. Supported options:
- all
- only-failed
- none
required: true
required: false
default: 'all'
max-annotations:
description: |
Limits number of created annotations with error message and stack trace captured during test execution.
Must be less or equal to 50.
required: true
required: false
default: '10'
fail-on-error:
description: Set this action as failed if test report contain any failed test
required: false
default: 'true'
fail-on-empty:
description: Set this action as failed if no test results were found
required: true
default: 'true'
working-directory:
Expand Down Expand Up @@ -85,6 +89,10 @@ outputs:
description: Count of skipped tests
time:
description: Test execution time [ms]
url:
description: Check run URL
url_html:
description: Check run URL HTML
runs:
using: 'node16'
main: 'dist/index.js'
Expand Down
Loading

0 comments on commit 1e3a380

Please sign in to comment.