Skip to content

Commit

Permalink
build: Publish rust test results
Browse files Browse the repository at this point in the history
Running tests results in multiple testsuites if you use "--format junit" which results in an invalid XML file.  These can be aggregated by Formatting the results as JSON and using cargo2junit to reformat the results as JUnit XML.
  • Loading branch information
Steve Vaughan committed Mar 5, 2024
1 parent a131c44 commit 2c3ec7d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/actions/rust-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ runs:
shell: bash
run: |
cd core
RUST_BACKTRACE=1 cargo test
mkdir -p target/cargo-reports
RUST_BACKTRACE=1 cargo test --release --color=never -- --color=never -Zunstable-options --report-time --format json | cargo2junit > target/cargo-reports/TEST-all.xml
8 changes: 8 additions & 0 deletions .github/actions/setup-builder/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@ runs:
rustup toolchain install ${{inputs.rust-version}}
rustup default ${{inputs.rust-version}}
rustup component add rustfmt clippy
- name: Setup Rust cargo2junit
shell: bash
# Running tests results in multiple testsuites if you use "--format junit" which results in
# an invalid XML file. These can be aggregated by Formatting the results as JSON and using
# cargo2junit to reformat the results as JUnit XML.
run: |
cargo install cargo2junit
8 changes: 8 additions & 0 deletions .github/actions/setup-macos-builder/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,11 @@ runs:
rustup toolchain install ${{inputs.rust-version}}
rustup default ${{inputs.rust-version}}
rustup component add rustfmt clippy
- name: Setup Rust cargo2junit
shell: bash
# Running tests results in multiple testsuites if you use "--format junit" which results in
# an invalid XML file. These can be aggregated by Formatting the results as JSON and using
# cargo2junit to reformat the results as JUnit XML.
run: |
cargo install cargo2junit

0 comments on commit 2c3ec7d

Please sign in to comment.