From 744984861bc59bc2e60b8efc0041c94dc7b27cbd Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Tue, 15 Jun 2021 00:00:55 +0200 Subject: [PATCH 1/4] Add build to the test --- .github/workflows/golang-test.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/golang-test.yml b/.github/workflows/golang-test.yml index c5e338316..920a0f8ae 100644 --- a/.github/workflows/golang-test.yml +++ b/.github/workflows/golang-test.yml @@ -18,4 +18,33 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Test - run: go test ./... \ No newline at end of file + run: go test ./... + + test_build: + strategy: + matrix: + os: [ windows, linux, macos ] + go-version: [1.16.x] + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Cache Go modules + uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Install modules + run: go mod tidy + + - name: run build + run: GOOS=${{ matrix.go-version }} go build . \ No newline at end of file From 7df6cde968db67e31c573249282cc9a0ca59713c Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Tue, 15 Jun 2021 00:02:42 +0200 Subject: [PATCH 2/4] fix a typo and rename the embedded dll --- iface/iface_darwin.go | 2 +- ...urces_amd64.syso => resources_windows_amd64.syso | Bin 2 files changed, 1 insertion(+), 1 deletion(-) rename resources_amd64.syso => resources_windows_amd64.syso (100%) diff --git a/iface/iface_darwin.go b/iface/iface_darwin.go index 9e566844d..aa963e25e 100644 --- a/iface/iface_darwin.go +++ b/iface/iface_darwin.go @@ -18,7 +18,7 @@ func assignAddr(address string, tunDevice tun.Device) error { ip := strings.Split(address, "/") cmd := exec.Command("ifconfig", ifaceName, "inet", address, ip[0]) if out, err := cmd.CombinedOutput(); err != nil { - log.Infoln("Command: %v failed with output %s and error: ", cmd.String(), out) + log.Infof("Command: %v failed with output %s and error: ", cmd.String(), out) return err } _, resolvedNet, err := net.ParseCIDR(address) diff --git a/resources_amd64.syso b/resources_windows_amd64.syso similarity index 100% rename from resources_amd64.syso rename to resources_windows_amd64.syso From d5c4f6cb40016698f4e0af36604bfdd8b2819135 Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Tue, 15 Jun 2021 00:08:54 +0200 Subject: [PATCH 3/4] fix matrix var to use os --- .github/workflows/golang-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golang-test.yml b/.github/workflows/golang-test.yml index 920a0f8ae..96ab33160 100644 --- a/.github/workflows/golang-test.yml +++ b/.github/workflows/golang-test.yml @@ -47,4 +47,4 @@ jobs: run: go mod tidy - name: run build - run: GOOS=${{ matrix.go-version }} go build . \ No newline at end of file + run: GOOS=${{ matrix.os }} go build . \ No newline at end of file From 714c4c3c44957a5d4563ae7d7d1ebc0afeba969b Mon Sep 17 00:00:00 2001 From: mlsmaycon Date: Tue, 15 Jun 2021 00:13:52 +0200 Subject: [PATCH 4/4] use darwin --- .github/workflows/golang-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golang-test.yml b/.github/workflows/golang-test.yml index 96ab33160..df5b30b3c 100644 --- a/.github/workflows/golang-test.yml +++ b/.github/workflows/golang-test.yml @@ -23,7 +23,7 @@ jobs: test_build: strategy: matrix: - os: [ windows, linux, macos ] + os: [ windows, linux, darwin ] go-version: [1.16.x] runs-on: ubuntu-latest steps: