From 2e97bb2d7b94c50e9dc15a75b500ffbad7e05527 Mon Sep 17 00:00:00 2001
From: Hazel <hazel@farfrom.earth>
Date: Fri, 6 Oct 2023 15:52:28 +0100
Subject: [PATCH] attempt i. at caching haxe installs

---
 .github/actions/setup-haxeshit/action.yml | 43 +++++++++++++++--------
 1 file changed, 28 insertions(+), 15 deletions(-)

diff --git a/.github/actions/setup-haxeshit/action.yml b/.github/actions/setup-haxeshit/action.yml
index e96181ce4..756530178 100644
--- a/.github/actions/setup-haxeshit/action.yml
+++ b/.github/actions/setup-haxeshit/action.yml
@@ -3,18 +3,31 @@ description: "sets up haxe shit, using HMM!"
 runs:
   using: "composite"
   steps:
-      - uses: krdlab/setup-haxe@v1.5.1
-        with:
-          haxe-version: 4.3.1
-      - name: Config haxelib
-        run: |
-          haxelib config
-        shell: bash
-      - name: Installing Haxe lol
-        run: |
-          haxe -version
-          haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git development
-          haxelib version
-          haxelib --global install hmm
-          haxelib --global run hmm install
-        shell: bash
+    - uses: krdlab/setup-haxe@v1.5.1
+      with:
+        haxe-version: 4.3.1
+    - name: Config haxelib
+      run: |
+        haxelib config
+      shell: bash
+    - name: Installing Haxe lol
+      run: |
+        haxe -version
+        haxelib git haxelib https://github.com/HaxeFoundation/haxelib.git development
+        haxelib version
+        haxelib --global install hmm
+      shell: bash
+    - name: dependency install cache
+      id: cache-hmm
+      uses: actions/cache@v3
+      with:
+        path: .haxelib
+        key: ${{ runner.os }}-hmm-${{ hashFiles('**/hmm.json') }}
+        restore-keys: |
+          ${{ runner.os }}-hmm-
+          ${{ runner.os }}-
+    - if: ${{ steps.cache-hmm.outputs.cache-hit != 'true' }}
+      name: hmm install
+      run: |
+        haxelib --global run hmm install
+      shell: bash