Przeglądaj źródła

attempt cache builds

Dax Raad 10 miesięcy temu
rodzic
commit
259858df5f
2 zmienionych plików z 28 dodań i 0 usunięć
  1. 14 0
      .github/workflows/build.yml
  2. 14 0
      .github/workflows/release.yml

+ 14 - 0
.github/workflows/build.yml

@@ -25,8 +25,22 @@ jobs:
       - uses: actions/setup-go@v5
       - uses: actions/setup-go@v5
         with:
         with:
           go-version: ">=1.23.2"
           go-version: ">=1.23.2"
+          cache: true
+          cache-dependency-path: go.sum
 
 
       - run: go mod download
       - run: go mod download
+
+      - name: Cache GoReleaser build
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.cache/go-build
+            dist/
+            .goreleaser.cache
+          key: ${{ runner.os }}-go-build-${{ hashFiles('**/*.go') }}-${{ hashFiles('go.sum') }}
+          restore-keys: |
+            ${{ runner.os }}-go-build-
+
       - uses: goreleaser/goreleaser-action@v6
       - uses: goreleaser/goreleaser-action@v6
         with:
         with:
           distribution: goreleaser
           distribution: goreleaser

+ 14 - 0
.github/workflows/release.yml

@@ -25,8 +25,22 @@ jobs:
       - uses: actions/setup-go@v5
       - uses: actions/setup-go@v5
         with:
         with:
           go-version: ">=1.23.2"
           go-version: ">=1.23.2"
+          cache: true
+          cache-dependency-path: go.sum
 
 
       - run: go mod download
       - run: go mod download
+      
+      - name: Restore GoReleaser build cache
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.cache/go-build
+            dist/
+            .goreleaser.cache
+          key: ${{ runner.os }}-go-build-${{ hashFiles('**/*.go') }}-${{ hashFiles('go.sum') }}
+          restore-keys: |
+            ${{ runner.os }}-go-build-
+      
       - uses: goreleaser/goreleaser-action@v6
       - uses: goreleaser/goreleaser-action@v6
         with:
         with:
           distribution: goreleaser
           distribution: goreleaser