Răsfoiți Sursa

Merge branch 'next' into trad_fr

James Read 20 ore în urmă
părinte
comite
e67cc1189e

+ 5 - 1
.github/workflows/build-and-release.yml

@@ -98,7 +98,11 @@ jobs:
         with:
           go-version-file: 'service/go.mod'
           cache: true
-          cache-dependency-path: 'service/go.mod'
+          # Keyed per workflow, as each builds different artifacts.
+          cache-dependency-path: |
+            service/go.mod
+            service/go.sum
+            .github/workflows/build-and-release.yml
 
       - name: Print go version
         run: go version

+ 2 - 2
.github/workflows/build-buf.yml

@@ -24,8 +24,8 @@ jobs:
         uses: actions/setup-go@v5
         with:
           go-version-file: 'service/go.mod'
-          cache: true
-          cache-dependency-path: 'service/go.mod'
+          # buf does not build Go code; a cache saved here would be empty.
+          cache: false
 
       - uses: bufbuild/buf-action@v1.1.0
         with:

+ 6 - 1
.github/workflows/codeql-analysis.yml

@@ -53,11 +53,16 @@ jobs:
         uses: actions/checkout@v4
 
       - name: Setup Go
+        if: matrix.language == 'go'
         uses: actions/setup-go@v5
         with:
           go-version-file: 'service/go.mod'
           cache: true
-          cache-dependency-path: 'service/go.mod'
+          # Keyed per workflow, as each builds different artifacts.
+          cache-dependency-path: |
+            service/go.mod
+            service/go.sum
+            .github/workflows/codeql-analysis.yml
 
       - name: Setup Node
         if: matrix.language == 'javascript'

+ 5 - 1
.github/workflows/codestyle.yml

@@ -34,7 +34,11 @@ jobs:
         with:
           go-version-file: 'service/go.mod'
           cache: true
-          cache-dependency-path: 'service/go.mod'
+          # Keyed per workflow, as each builds different artifacts.
+          cache-dependency-path: |
+            service/go.mod
+            service/go.sum
+            .github/workflows/codestyle.yml
 
       - name: Print go version
         run: go version

+ 5 - 1
.github/workflows/race.yml

@@ -30,7 +30,11 @@ jobs:
         with:
           go-version-file: 'service/go.mod'
           cache: true
-          cache-dependency-path: 'service/go.mod'
+          # Keyed per workflow, as each builds different artifacts.
+          cache-dependency-path: |
+            service/go.mod
+            service/go.sum
+            .github/workflows/race.yml
 
       - name: Run race detector
         run: make -wC service unittests-race

+ 7 - 1
frontend/Makefile

@@ -14,8 +14,14 @@ unittests: deps
 clean:
 	$(call delete-files,dist)
 
-deps:
+# Only run npm ci again when package.json or the lockfile is newer than the
+# last clean install, or when npm has changed node_modules since (for example
+# npm install), which rewrites node_modules/.package-lock.json.
+deps: node_modules/.npm-ci-stamp
+
+node_modules/.npm-ci-stamp: package.json package-lock.json $(wildcard node_modules/.package-lock.json)
 	npm ci
+	touch $@
 
 build:
 	npm run build

+ 7 - 6
integration-tests/runner.mjs

@@ -136,12 +136,13 @@ class OliveTinTestRunnerStartLocalProcess extends OliveTinTestRunner {
 
     this.ot = null
 
-    if (process.env.CI === 'true') {
-      // GitHub runners seem to need a bit more time to clean up
-      await new Promise((res) => setTimeout(res, 3000))
-    } else {
-      await new Promise((res) => setTimeout(res, 50))
-    }
+    // The next suite binds the same ports, so wait until they are released
+    // rather than sleeping for a guessed amount of time.
+    await waitOn({
+      resources: ['tcp:127.0.0.1:1337', 'tcp:127.0.0.1:1341'],
+      reverse: true,
+      timeout: 10000,
+    })
   }
 }