GitHub 此操作会从 Xcode 结果包中生成人类可读的测试报告,并在 GitHub 检查中显示该报告。
A GitHub Action that generates a human-readable test report from the Xcode result bundle and shows it on GitHub Checks.
The result is formatted into a test report that shows the success or failure of the tests, code coverages, logs, activities, and saved screenshots.
Here is an example result.
This action only works on macOS builders.
By default xcodebuild will generate the xcresult bundle file to a randomly named directory in DerivedData. To use this action xcodebuild
needs to generate xcresult bundle to an accessible location.
This can be done using the -resultBundlePath flag in xcodebuild.
The following action uses a script action to invoke xcodebuild and store the results
in TestResults.xcresult
jobs:
test:
runs-on: macos-11
- name: Run Tests
run: |
xcodebuild -scheme MyFramework -resultBundlePath TestResults testFor complete input/output documentation, see action.yml.
- uses: kishikawakatsumi/xcresulttool@v1
with:
path: TestResults.xcresult
if: success() || failure()
# ^ This is important because the action will be run
# even if the test fails in the previous step.jobs:
test:
runs-on: macos-11
name: Test
steps:
- uses: actions/checkout@v2
- name: Test
run: |
xcodebuild -scheme MyFramework -resultBundlePath TestResults test
- uses: kishikawakatsumi/xcresulttool@v1
with:
path: TestResults.xcresult
if: success() || failure()
# ^ This is important because the action will be run
# even if the test fails in the previous step.- uses: kishikawakatsumi/xcresulttool@v1
with:
path: |
results/Example.xcresult
results/TestResult.xcresult
results/Result.xcresult
if: success() || failure()…GitHub Checks has a maximum text limit of 65535 characters. Currently, any text longer than that will be automatically truncated.
There is a limit of 50 annotations in GitHub Checks. Currently, any annotations longer than that will be automatically truncated.
You can set the show-passed-tests option to false to reduce the output to avoid the limitation.
暂无开放 Issues,或尚未同步最近议题。