... reports JUnit test results as GitHub pull request check.
What's included 🚀 • Setup 🛠️ • Sample 🖥️ • Contribute 🧬 • License 📓
- Flexible JUnit parser with wide support
- Supports nested test suites
- Blazingly fast execution
- Lighweight
- Rich build log output
This action processes JUnit XML test reports on pull requests and shows the result as a PR check with summary and annotations.
Based on action for Surefire Reports by ScaCap
name: build
on:
pull_request:
jobs:
build:
name: Build and Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1
- name: Build and Run Tests
run: # execute your tests generating test results
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: always() # always run even if the previous step fails
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
Input | Description |
---|---|
report_paths |
Required. Glob expression to junit report paths. The default is **/junit-reports/TEST-*.xml . |
token |
Optional. GitHub token for creating a check run. Set to ${{ github.token }} by default. |
exclude_sources |
Optional. Provide , seperated array of folders to ignore for source lookup. Defaults to: /build/,/__pycache__/
|
check_name |
Optional. Check name to use when creating a check run. The default is JUnit Test Report . |
suite_regex |
Optional. Regular expression for the named test suites. E.g. Test*
|
commit |
Optional. The commit SHA to update the status. This is useful when you run it with workflow_run . |
fail_on_failure |
Optional. Fail the build in case of a test failure. |
require_tests |
Optional. Fail if no test are found.. |
check_retries |
Optional. If a testcase is retried, ignore the original failure. |
check_title_template |
Optional. Template to configure the title format. Placeholders: ${{FILE_NAME}}, ${{SUITE_NAME}}, ${{TEST_NAME}}. |
summary |
Optional. Additional text to summary output |
# Install the dependencies
$ npm install
# Verify lint is happy
$ npm run lint -- --fix
# Build the typescript and package it for distribution
$ npm run build && npm run package
# Run the tests, use to debug, and test it out
$ npm test
Original idea and GitHub Actions by: https://github.com/ScaCap/action-surefire-report
Copyright (C) 2022 Mike Penz
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.