Matthew R. Kasun 3 years ago
parent
commit
d2a0f2057e
1 changed files with 21 additions and 19 deletions
  1. 21 19
      .github/workflows/test.yml

+ 21 - 19
.github/workflows/test.yml

@@ -12,23 +12,16 @@ jobs:
       - name: Setup Go
       - name: Setup Go
         uses: actions/setup-go@v2
         uses: actions/setup-go@v2
         with:
         with:
-            go-version: 1.18
+          go-version: 1.18
       - name: Build
       - name: Build
         run: |
         run: |
-         sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
          env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build main.go
          env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build main.go
          cd netclient
          cd netclient
          env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
          env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
          env CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build main.go
          env CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build main.go
          env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go
          env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go
          env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go
          env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go
-         env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags=gui main.go 
-         #env CGO_ENABLED=1 GOOS=freebsd GOARCH=amd64 go build -tags=gui main.go 
-         env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -tags=gui main.go 
-         #env CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -tags=gui main.go 
-  test-linux:
-    env:
-      DATABASE: sqlite
+  linux-gui:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     steps:
     steps:
       - name: Checkout
       - name: Checkout
@@ -37,17 +30,27 @@ jobs:
         uses: actions/setup-go@v2
         uses: actions/setup-go@v2
         with:
         with:
           go-version: 1.18
           go-version: 1.18
-      - name: run tests
+      - name: Build
         run: |
         run: |
-            sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
-            go test -p 1 ./... -v
-        env:
-          DATABASE: sqlite
-          CLIENT_MODE: "off"
-  test-darwin:
+         sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
+         env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags=gui main.go
+  mac-gui:
+    runs-on: macos-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Setup Go
+        uses: actions/setup-go@v2
+        with:
+          go-version: 1.18
+      - name: Build mac
+        run: |
+          xcode-select --install
+          env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -tags=gui main.go
+  tests:
     env:
     env:
       DATABASE: sqlite
       DATABASE: sqlite
-    runs-on: macos-latest
+    runs-on: ubuntu-latest
     steps:
     steps:
       - name: Checkout
       - name: Checkout
         uses: actions/checkout@v2
         uses: actions/checkout@v2
@@ -57,9 +60,8 @@ jobs:
           go-version: 1.18
           go-version: 1.18
       - name: run tests
       - name: run tests
         run: |
         run: |
-            xcode-select install
+            sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
             go test -p 1 ./... -v
             go test -p 1 ./... -v
         env:
         env:
           DATABASE: sqlite
           DATABASE: sqlite
           CLIENT_MODE: "off"
           CLIENT_MODE: "off"
-