mirror of
https://github.com/imsnif/bandwhich.git
synced 2026-02-09 01:59:18 +08:00
CI: test using cargo-insta
This commit is contained in:
9
.github/workflows/ci.yaml
vendored
9
.github/workflows/ci.yaml
vendored
@@ -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' }}
|
||||
|
||||
Reference in New Issue
Block a user