Files
netbird/.github/workflows/golang-test-windows.yml
2023-04-08 11:25:57 +02:00

55 lines
1.6 KiB
YAML

name: Test Code Windows
on:
push:
branches:
- main
pull_request:
env:
downloadPath: '${{ github.workspace }}\temp'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.actor_id }}
cancel-in-progress: true
jobs:
test:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- name: Download wintun
uses: carlosperate/download-file-action@v2
id: download-wintun
with:
file-url: https://www.wintun.net/builds/wintun-0.14.1.zip
file-name: wintun.zip
location: ${{ env.downloadPath }}
sha256: '07c256185d6ee3652e09fa55c0b673e2624b565e02c4b9091c79ca7d2f24ef51'
- name: Decompressing wintun files
run: tar -zvxf "${{ steps.download-wintun.outputs.file-path }}" -C ${{ env.downloadPath }}
- run: mv ${{ env.downloadPath }}/wintun/bin/amd64/wintun.dll 'C:\Windows\System32\'
- name: Download PaExec
run: |
choco install wget --no-progress
wget -q https://www.poweradmin.com/paexec/paexec.exe -P C:\Windows\System32
- name: Generate Iface Test bin
run: go test -c -o iface-testing.bin.exe ./iface/
- name: Test
if: ${{ always() }}
run: |
mv iface-testing.bin.exe 'C:\Windows\temp\'
paexec -lo $pwd\output.txt -s 'C:\Windows\temp\iface-testing.bin.exe'
- name: print log
if: ${{ always() }}
run: Get-Content $pwd\output.txt