From 0633c4a16d78ef7abb53166369df0b328c7c8db7 Mon Sep 17 00:00:00 2001 From: Sergey Chernyshev Date: Sat, 20 Apr 2024 12:40:37 -0400 Subject: [PATCH] Cache SCC (#11) Cache SCC, named caches to be more fun --- action.yml | 22 ++++++++++++++++------ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 19445a1..63a47f7 100644 --- a/action.yml +++ b/action.yml @@ -16,7 +16,18 @@ runs: with: path: "scrolls" - - name: Inviting the wizard to extract the inner knowledge + - name: Asking our wizard to extract the inner knowledge + id: cache-scc + uses: actions/cache@v4 + env: + cache-name: our-wizard + with: + # we don't expect SCC to change, just use the same version all the time + path: wizard/ + key: ${{ env.cache-name }} + + - if: ${{ steps.cache-scc.outputs.cache-hit != 'true' }} + name: Inviting a wizard from a distant land run: | mkdir -p wizard wget https://github.com/boyter/scc/releases/download/v3.2.0/scc_Linux_x86_64.tar.gz -O wizard/scc.gz @@ -37,15 +48,14 @@ runs: id: cache-npm uses: actions/cache@v4 env: - cache-name: cache-node-modules + cache-name: tool-stash with: # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('builders/package-lock.json') }} + key: ${{ env.cache-name }}-${{ runner.os }}-${{ hashFiles('builders/package-lock.json') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ env.cache-name }}-${{ runner.os }}- + ${{ env.cache-name }}- - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} name: Check the empty stash diff --git a/package-lock.json b/package-lock.json index 1fb9609..769801a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gitterra", - "version": "1.1.2", + "version": "1.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gitterra", - "version": "1.1.2", + "version": "1.1.3", "license": "MIT", "dependencies": { "kmeansjs": "^0.0.3" diff --git a/package.json b/package.json index cb8ddd9..96bb9bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gitterra", - "version": "1.1.2", + "version": "1.1.3", "description": "A git-based game running in CI/CD and played by coding", "main": "src/generateMap.js", "scripts": {