From bb2e5387a97a91ba415b1219d416fdafbf620dd4 Mon Sep 17 00:00:00 2001 From: FujiApple Date: Thu, 4 Jan 2024 13:29:58 +0800 Subject: [PATCH] test: add tun integration test (WIP) - 5 --- .github/workflows/ci.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d9f69d03..76acf95d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,7 @@ jobs: build: - linux-stable - macos-stable + - windows-stable include: - build: linux-stable os: ubuntu-20.04 @@ -67,6 +68,10 @@ jobs: os: macos-latest target: x86_64-apple-darwin rust: stable + - build: windows-stable + os: windows-latest + target: x86_64-pc-windows-msvc + rust: stable steps: - uses: actions/checkout@v2 - uses: Swatinem/rust-cache@v2 @@ -74,28 +79,22 @@ jobs: with: toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} - - run: sudo -E env "PATH=$PATH" cargo test --target ${{ matrix.target }} --features sim-tests --test sim -- --exact --nocapture - - sim-test-windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v2 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - target: x86_64-pc-windows-msvc - name: Copy wintun.dll to current dir + if: startsWith(matrix.build, 'windows') shell: bash run: | cp "tests/resources/wintun.dll" "." - name: Allow ICMPv4 and ICMPv6 in Windows defender firewall + if: startsWith(matrix.build, 'windows') shell: pwsh run: | New-NetFirewallRule -DisplayName "ICMPv4 Trippy Allow" -Name ICMPv4_TRIPPY_ALLOW -Protocol ICMPv4 -Action Allow New-NetFirewallRule -DisplayName "ICMPv6 Trippy Allow" -Name ICMPv6_TRIPPY_ALLOW -Protocol ICMPv6 -Action Allow - - run: cargo test --target x86_64-pc-windows-msvc --features sim-tests --test sim -- --exact --nocapture - + - run: sudo -E env "PATH=$PATH" cargo test --target ${{ matrix.target }} --features sim-tests --test sim -- --exact --nocapture + if: !startsWith(matrix.build, 'windows') + - run: cargo test --target --target ${{ matrix.target }} --features sim-tests --test sim -- --exact --nocapture + if: startsWith(matrix.build, 'windows') + fmt: runs-on: ubuntu-22.04 steps: