Explorar el Código

Testing PR rules (#2798)

Added caching and parallel go tests
Stefan McShane hace 3 años
padre
commit
ff1215b490
Se han modificado 2 ficheros con 14 adiciones y 8 borrados
  1. 13 8
      .github/workflows/test-backend.yml
  2. 1 0
      api/server/shared/config/loader/loader.go

+ 13 - 8
.github/workflows/test-backend.yml

@@ -2,12 +2,17 @@ name: Backend CI
 on:
   - pull_request
 jobs:
-  backend-tests:
-    name: Run Go tests
-    runs-on: ubuntu-latest
+  testing_matrix:
+    strategy:
+      matrix:
+        go-version: [1.20.x]
+        os: [ubuntu-latest]
+        folder: [cli, api, cmd, internal, provisioner]
+    name: Running ${{ matrix.folder }} tests on Go ${{ matrix.go-version }} on ${{ matrix.os }}
+    runs-on: ${{ matrix.os }}
     steps:
-    - uses: actions/checkout@v3
-    - uses: actions/setup-go@v3
-      with:
-        go-version: '^1.15.1'
-    - run: go test ./...
+      - uses: actions/checkout@v3
+      - uses: actions/setup-go@v4
+        with:
+          go-version: ${{ matrix.go-version }}
+      - run: go test ./${{ matrix.folder }}/...

+ 1 - 0
api/server/shared/config/loader/loader.go

@@ -231,6 +231,7 @@ func (e *EnvConfigLoader) LoadConfig() (res *config.Config, err error) {
 				// 		return true
 				// 	}
 				// }
+
 				return origin == sc.ServerURL
 			},
 		},