From 53f6feae17c2cf1e950af114b18ea984475d38ca Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Sat, 7 Oct 2023 23:43:19 +0800 Subject: [PATCH] CI: upload failed test snapshots --- .github/workflows/ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe29060..9f64ab2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -80,11 +80,19 @@ jobs: & "$env:TEMP/npcap-oem.exe" /S - name: Run tests + 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 + - name: Upload snapshots of failed tests + if: ${{ steps.run_tests.outcome == 'failure' }} + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.os }}-${{ matrix.rust }}-failed_snapshots + path: src/tests/cases/snapshots/*.snap.new + - name: Upload unix binary if: matrix.os != 'windows-latest' uses: actions/upload-artifact@v3