diff options
author | cyqsimon <28627918+cyqsimon@users.noreply.github.com> | 2023-10-08 01:19:16 +0800 |
---|---|---|
committer | cyqsimon <28627918+cyqsimon@users.noreply.github.com> | 2023-10-08 01:19:16 +0800 |
commit | 138af259438fd7c63a708de175d873d35a2c7bc3 (patch) | |
tree | 42d4e904f916a1530ca6cabc96b16fc84e142a57 | |
parent | 96cbe63a9720bccba54e1fbf23256f8b5566055e (diff) |
CI: test using `cargo-insta`
-rw-r--r-- | .github/workflows/ci.yaml | 9 |
1 files 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' }} |