Просмотр исходного кода

ci: stop workflows from sharing and emptying the Go cache (#1195)

James Read 20 часов назад
Родитель
Сommit
a3cec26ad4

+ 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