From 2fed2c8223d96091855cb087d3653a5efe0ae139 Mon Sep 17 00:00:00 2001
From: Vladimir Rubin <vavakado@proton.me>
Date: Mon, 30 Dec 2024 17:53:25 +0200
Subject: [PATCH] ci: add caching

---
 .forgejo/workflows/build.yml | 53 ++++++++++++++++++++++--------------
 1 file changed, 32 insertions(+), 21 deletions(-)

diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml
index 2e5c7aa..61e8ebb 100644
--- a/.forgejo/workflows/build.yml
+++ b/.forgejo/workflows/build.yml
@@ -17,6 +17,17 @@ jobs:
       - name: Install Rust
         uses: https://github.com/dtolnay/rust-toolchain@stable
 
+      - name: Cache Rust dependencies
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.cargo/registry
+            ~/.cargo/git
+            target
+          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-cargo-
+
       - name: Build for Linux
         run: cargo build --release
 
@@ -26,24 +37,24 @@ jobs:
           name: linux-binary
           path: target/release/filesorters
 
-  build-windows:
-    name: Build for Windows
-    runs-on: ubuntu-latest-root
-
-    steps:
-      - uses: actions/checkout@v4
-
-      - name: Install Rust
-        uses: https://github.com/dtolnay/rust-toolchain@stable
-
-      - name: Install cross
-        run: cargo install cross
-
-      - name: Build for Windows
-        run: cross build --release --target x86_64-pc-windows-gnu
-
-      - name: Upload Windows artifact
-        uses: forgejo/upload-artifact@v4
-        with:
-          name: windows-binary
-          path: target/x86_64-pc-windows-gnu/release/filesorters.exe
+  # build-windows:
+  #   name: Build for Windows
+  #   runs-on: ubuntu-latest-root
+  #
+  #   steps:
+  #     - uses: actions/checkout@v4
+  #
+  #     - name: Install Rust
+  #       uses: https://github.com/dtolnay/rust-toolchain@stable
+  #
+  #     - name: Install cross
+  #       run: cargo install cross
+  #
+  #     - name: Build for Windows
+  #       run: cross build --release --target x86_64-pc-windows-gnu
+  #
+  #     - name: Upload Windows artifact
+  #       uses: forgejo/upload-artifact@v4
+  #       with:
+  #         name: windows-binary
+  #         path: target/x86_64-pc-windows-gnu/release/filesorters.exe