diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 0000000..f8d0d7d --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,29 @@ + +[profile.default] +# Print out output for failing tests as soon as they fail, and also at the end +# of the run (for easy scrollability). +failure-output = "immediate-final" + +[profile.ci-default-features] +# Do not cancel the test run on the first failure. +fail-fast = false + +[profile.ci-default-features.junit] +path = "junit-default-features.xml" +report-name = "default-features" + +[profile.ci-all-features] +# Do not cancel the test run on the first failure. +fail-fast = false + +[profile.ci-all-features.junit] +path = "junit-all-features.xml" +report-name = "all-features" + +[profile.ci-all-features-release] +# Do not cancel the test run on the first failure. +fail-fast = false + +[profile.ci-all-features-release.junit] +path = "junit-all-features-release.xml" +report-name = "all-features-release" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12a686b..c0dd1a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,6 +14,7 @@ on: env: RUST_LOG: info RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always jobs: test: @@ -27,23 +28,33 @@ jobs: rust: [stable, nightly] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: hecrj/setup-rust-action@v1 with: rust-version: ${{ matrix.rust }} + - uses: taiki-e/install-action@nextest - uses: actions-rs/cargo@v1 with: - command: test - args: --all-targets --verbose + command: nextest + args: run --profile ci-default-features --tests --examples --verbose + - uses: actions-rs/cargo@v1 + with: + command: nextest + args: run --profile ci-all-features --tests --examples --verbose --all-features + - uses: actions-rs/cargo@v1 + with: + command: nextest + args: run --profile ci-all-features-release --tests --examples --verbose --all-features --release - uses: actions-rs/cargo@v1 with: command: test - args: --all-targets --verbose --all-features - - uses: actions-rs/cargo@v1 + args: --doc --verbose --all-features + - uses: actions/upload-artifact@v2 # upload test results + if: success() || failure() # run this step even if previous step failed with: - command: test - args: --all-targets --verbose --all-features --release + name: test-results-${{ matrix.rust }}-${{ matrix.os }} + path: target/nextest/**/junit-*.xml check: name: Check diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 0000000..1c7cc09 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,16 @@ +name: 'Test Report' +on: + workflow_run: + workflows: ['CI'] # runs after CI workflow + types: + - completed +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: /test-results-([a-z]*)-(.*)/ # artifact name: test-results-- + name: cargo nextest results $1 $2 # Name of the check run which will be created + path: './**/junit-*.xml' # Path to test results (inside artifact .zip) + reporter: java-junit # Format of test results \ No newline at end of file