From 83aef81d3dc17a5f054c565d80ad959d0424de2c Mon Sep 17 00:00:00 2001
From: Ryan <ryankurte@users.noreply.github.com>
Date: Mon, 1 Feb 2021 14:51:40 +1300
Subject: [PATCH] Fix tar command, add caching

---
 .github/workflows/ci.yml | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index edee458..6170107 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,12 +33,32 @@ jobs:
 
     steps:
       - uses: actions/checkout@v2
+        
+      - name: Configure caching 
+        uses: actions/cache@v2
+        # Caching disabled on macos due to https://github.com/actions/cache/issues/403
+        if: ${{ matrix.os != 'macos-latest' }}
+        with:
+          key: ${{ matrix.os }}-${{ matrix.target }}
+          path: |
+            Sources/
+            output/
+            binutils-*/
+            gcc-*/
+            musl-*/
+            gmp-*/
+            mpc-*/
+            mpfr-*/
+            build-*/
+            linux-*/
+            isl-*/
+            build/
 
       - name: Build MUSL
         run: TARGET=${{ matrix.target }} make
 
       - name: Package outputs
-        run: tar -C build/local musl-${{ matrix.os }}-${{ matrix.target }}.tgz ${{matrix.target}}/*
+        run: tar -cf musl-${{ matrix.os }}-${{ matrix.target }}.tgz -C build/local ${{matrix.target}}
         
       - name: Upload artifacts
         uses: actions/upload-artifact@v1