From 138af259438fd7c63a708de175d873d35a2c7bc3 Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Sun, 8 Oct 2023 01:19:16 +0800 Subject: CI: test using `cargo-insta` --- .github/workflows/ci.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0d30b64..e504a14 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -68,6 +68,11 @@ jobs: - name: Run clippy run: cargo clippy --all-targets --all-features -- -D warnings + - name: Install cargo-insta + uses: taiki-e/install-action@v2 + with: + tool: cargo-insta + - name: Install npcap on Windows # PRs cannot not be trusted with repository secrets if: (matrix.os == 'windows-latest') && (github.event_name != 'pull_request') @@ -79,12 +84,12 @@ jobs: # see https://stackoverflow.com/a/1674950/5637701 & "$env:TEMP/npcap-oem.exe" /S - - name: Run tests + - name: Run tests using cargo-insta id: run_tests # npcap is needed to run tests on Windows, so this is an unfortunate # sacrifice we have to make in the name of security if: (matrix.os != 'windows-latest') || (github.event_name != 'pull_request') - run: cargo test --verbose + run: cargo insta test - name: Upload snapshots of failed tests if: ${{ failure() && steps.run_tests.outcome == 'failure' }} -- cgit v1.2.3