From a19489d5a470295202bd20dce5f224388ce5ba41 Mon Sep 17 00:00:00 2001 From: Katherine Bertelsen Date: Wed, 17 Apr 2024 22:50:26 -0500 Subject: [PATCH] Add action to cache dependencies on pushes to main (#48) --- .github/workflows/cache-dependencies.yml | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/cache-dependencies.yml diff --git a/.github/workflows/cache-dependencies.yml b/.github/workflows/cache-dependencies.yml new file mode 100644 index 000000000..66909de50 --- /dev/null +++ b/.github/workflows/cache-dependencies.yml @@ -0,0 +1,43 @@ +--- +name: Cache Dependencies + +on: + push: + branches: + - main + +env: + DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer + MINT_LINK_PATH: .mint/bin + MINT_PATH: .mint/lib + +jobs: + cache-dependencies: + name: Cache Dependencies + runs-on: macos-13 + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Ruby + uses: ruby/setup-ruby@5f19ec79cedfadb78ab837f95b87734d0003c899 # v1.173.0 + with: + bundler-cache: true + ruby-version: 3.2.2 + + - name: Cache Mint Packages + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: .mint + key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }} + restore-keys: | + ${{ runner.os }}-mint- + + - name: Install Mint + run: | + brew install mint + + - name: Install Mint packages + if: steps.mint-cache.outputs.cache-hit != 'true' + run: | + mint bootstrap