fix: fix go test errors (#2169)

* fix: fix go test errors

* Add flags to mac test

* Run on all branches

* Update PR workflow

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
Misite Bao
2022-12-06 06:45:06 +11:00
committed by GitHub
co-authored by Lea Anthony
parent 606ce3de1d
commit f70d9de366
125 changed files with 320 additions and 83 deletions
+10 -2
View File
@@ -2,7 +2,7 @@ name: Build + Test
on:
push:
branches: [*]
branches: [release/*, master]
workflow_dispatch:
jobs:
@@ -28,7 +28,15 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
- name: Run tests (mac)
if: matrix.os == 'macos-latest'
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
working-directory: ./v2
run: go test -v ./...
- name: Run tests (!mac)
if: matrix.os != 'macos-latest'
working-directory: ./v2
run: go test -v ./...
+10 -3
View File
@@ -48,7 +48,14 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
- name: Run tests (mac)
if: matrix.os == 'macos-latest'
env:
CGO_LDFLAGS: -framework UniformTypeIdentifiers -mmacosx-version-min=10.13
working-directory: ./v2
run: |
go test -v ./...
run: go test -v ./...
- name: Run tests (!mac)
if: matrix.os != 'macos-latest'
working-directory: ./v2
run: go test -v ./...
+1 -1
View File
@@ -1,4 +1,4 @@
name: Push
name: Push Checks
on:
push:
+7 -6
View File
@@ -2,6 +2,11 @@ package main
import (
"fmt"
"os"
"runtime"
"strings"
"time"
"github.com/leaanthony/slicer"
"github.com/pterm/pterm"
"github.com/wailsapp/wails/v2/cmd/wails/flags"
@@ -10,10 +15,6 @@ import (
"github.com/wailsapp/wails/v2/internal/project"
"github.com/wailsapp/wails/v2/pkg/clilogger"
"github.com/wailsapp/wails/v2/pkg/commands/build"
"os"
"runtime"
"strings"
"time"
)
func buildApplication(f *flags.Build) error {
@@ -167,12 +168,12 @@ func buildApplication(f *flags.Build) error {
switch buildOptions.Platform {
case "linux":
if runtime.GOOS != "linux" {
pterm.Warning.Println("Crosscompiling to Linux not currently supported.\n")
pterm.Warning.Println("Crosscompiling to Linux not currently supported.")
return
}
case "darwin":
if runtime.GOOS != "darwin" {
pterm.Warning.Println("Crosscompiling to Mac not currently supported.\n")
pterm.Warning.Println("Crosscompiling to Mac not currently supported.")
return
}
macTargets := targets.Filter(func(platform string) bool {
+5 -4
View File
@@ -1,14 +1,15 @@
package main
import (
"runtime"
"runtime/debug"
"strings"
"github.com/pterm/pterm"
"github.com/wailsapp/wails/v2/cmd/wails/flags"
"github.com/wailsapp/wails/v2/internal/colour"
"github.com/wailsapp/wails/v2/internal/system"
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
"runtime"
"runtime/debug"
"strings"
)
func diagnoseEnvironment(f *flags.Doctor) error {
@@ -144,7 +145,7 @@ func diagnoseEnvironment(f *flags.Doctor) error {
if len(dependenciesMissing) == 0 && dependenciesAvailableRequired == 0 {
pterm.Println("Your system is ready for Wails development!")
} else {
pterm.Println("Your system has missing dependencies!\n")
pterm.Println("Your system has missing dependencies!")
}
if dependenciesAvailableRequired != 0 {
+4 -3
View File
@@ -2,11 +2,12 @@ package main
import (
"fmt"
"github.com/pterm/pterm"
"github.com/wailsapp/wails/v2/cmd/wails/internal"
"os"
"strings"
"github.com/pterm/pterm"
"github.com/wailsapp/wails/v2/cmd/wails/internal"
"github.com/wailsapp/wails/v2/internal/colour"
"github.com/leaanthony/clir"
@@ -52,7 +53,7 @@ func printFooter() {
},
}
printer.Println("If Wails is useful to you or your company, please consider sponsoring the project:")
pterm.Println("https://github.com/sponsors/leaanthony\n")
pterm.Println("https://github.com/sponsors/leaanthony")
}
func bool2Str(b bool) string {
+5 -3
View File
@@ -2,12 +2,13 @@ package main
import (
"fmt"
"os"
"github.com/labstack/gommon/color"
"github.com/pterm/pterm"
"github.com/wailsapp/wails/v2/cmd/wails/flags"
"github.com/wailsapp/wails/v2/internal/colour"
"github.com/wailsapp/wails/v2/internal/shell"
"os"
"github.com/wailsapp/wails/v2/internal/github"
)
@@ -76,7 +77,7 @@ func updateToVersion(targetVersion *github.SemanticVersion, force bool, currentV
var targetVersionString = "v" + targetVersion.String()
if targetVersionString == currentVersion {
pterm.Println("\nLooks like you're up to date!\n")
pterm.Println("\nLooks like you're up to date!")
return nil
}
@@ -122,7 +123,8 @@ func updateToVersion(targetVersion *github.SemanticVersion, force bool, currentV
// Compare
if !success {
pterm.Println("Error: The requested version is lower than the current version.")
pterm.Println("If this is what you really want to do, use `wails update -version %s`", targetVersionString)
pterm.Println(fmt.Sprintf("If this is what you really want to do, use `wails update -version "+"%s`", targetVersionString))
return nil
}
@@ -1,9 +1,12 @@
//go:build windows
package windows
import (
"testing"
"github.com/wailsapp/wails/v2/internal/frontend"
"golang.org/x/sys/windows"
"testing"
)
func Test_calculateMessageDialogFlags(t *testing.T) {
@@ -1,10 +1,13 @@
//go:build windows
package w32
import (
"golang.org/x/sys/windows"
"syscall"
"unicode/utf16"
"unsafe"
"golang.org/x/sys/windows"
)
var (
@@ -1,3 +1,5 @@
//go:build windows
package combridge
import (
@@ -1,3 +1,5 @@
//go:build windows
package combridge
import (
@@ -1,3 +1,5 @@
//go:build windows
package combridge
import (
@@ -1,3 +1,5 @@
//go:build windows
package combridge
import (
@@ -1,3 +1,5 @@
//go:build windows
package combridge
import (
@@ -1,3 +1,5 @@
//go:build windows
package edge
type COREWEBVIEW2_COLOR struct {
@@ -1,3 +1,5 @@
//go:build windows
package edge
type COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND uint32
@@ -1,3 +1,5 @@
//go:build windows
package edge
type COREWEBVIEW2_KEY_EVENT_KIND uint32
@@ -1,3 +1,5 @@
//go:build windows
package edge
type COREWEBVIEW2_MOVE_FOCUS_REASON uint32
@@ -1,3 +1,5 @@
//go:build windows
package edge
type COREWEBVIEW2_PHYSICAL_KEY_STATUS struct {
@@ -1,3 +1,5 @@
//go:build windows
package edge
type COREWEBVIEW2_WEB_RESOURCE_CONTEXT uint32

Some files were not shown because too many files have changed in this diff Show More