Browse Source

Merge pull request #1919 from gravitl/gra-685-workflow

split tests and static checks into separate jobs
dcarns 2 years ago
parent
commit
da7ba76f22
1 changed files with 13 additions and 43 deletions
  1. 13 43
      .github/workflows/test.yml

+ 13 - 43
.github/workflows/test.yml

@@ -6,6 +6,7 @@ on:
     types: [opened, synchronize, reopened]
 
 jobs:
+
   build:
     runs-on: ubuntu-latest
     steps:
@@ -19,6 +20,7 @@ jobs:
         run: |
          env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build main.go
          env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags=ee main.go
+
   nmctl:
     runs-on: ubuntu-latest
     steps:
@@ -35,34 +37,9 @@ jobs:
           GOOS=darwin GOARCH=amd64 go build -o nmctl
           GOOS=darwin GOARCH=arm64 go build -o nmctl
           GOOS=windows GOARCH=amd64 go build -o nmctl
-  linux-gui:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout
-        uses: actions/checkout@v3
-      - name: Setup Go
-        uses: actions/setup-go@v3
-        with:
-          go-version: 1.19
-      - name: Build
-        run: |
-         sudo apt-get update
-         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@v3
-      - name: Setup Go
-        uses: actions/setup-go@v3
-        with:
-          go-version: 1.19
-      - name: Build mac
-        run: |
-          env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -tags=gui main.go
-  win-gui:
-    runs-on: windows-latest
+
+  tests:
+    runs-on: ubuntu-22.04
     steps:
       - name: Checkout
         uses: actions/checkout@v3
@@ -70,16 +47,14 @@ jobs:
         uses: actions/setup-go@v3
         with:
           go-version: 1.19
-      - name: Mysys2 setup
-        uses: msys2/setup-msys2@v2
-        with:
-          install: >-
-            git
-            mingw-w64-x86_64-toolchain
-      - name: Build win gui
+      - name: run tests
         run: |
-          env CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -tags=gui main.go
-  tests:
+          go test -p 1 ./... -v
+        env:
+          DATABASE: sqlite
+          CLIENT_MODE: "off"
+
+  staticcheck:
     env:
       DATABASE: sqlite
     runs-on: ubuntu-22.04
@@ -90,13 +65,8 @@ jobs:
         uses: actions/setup-go@v3
         with:
           go-version: 1.19
-      - name: run tests
+      - name: run static checks
         run: |
           sudo apt update
-          sudo apt-get install -y gcc libgl1-mesa-dev xorg-dev
-          go test -p 1 ./... -v
           go install honnef.co/go/tools/cmd/staticcheck@latest
           { ~/go/bin/staticcheck  -tags=ee ./... ; }
-        env:
-          DATABASE: sqlite
-          CLIENT_MODE: "off"