From 4d8d2369a34e7fdc81a5d091bb97901a03c2f7d3 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Wed, 11 Dec 2024 10:58:53 -0500 Subject: [PATCH] Use cache GHA restore/save for PhantomJS --- setup-phantomjs/action.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/setup-phantomjs/action.yaml b/setup-phantomjs/action.yaml index 9cfa1cc..1330003 100644 --- a/setup-phantomjs/action.yaml +++ b/setup-phantomjs/action.yaml @@ -52,16 +52,15 @@ runs: cat("path=/tmp/phantomjs-not-found\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE) cat("should-install=false", file = Sys.getenv("GITHUB_OUTPUT"), append = TRUE) } - - name: Cache PhantomJS + - name: Restore PhantomJS cache if: ${{ steps.phantomjs.outputs.should-install == 'true' }} - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: ${{ steps.phantomjs.outputs.path }} key: ${{ runner.os }}-phantomjs-${{ inputs.cache-version }} # Restore from `save` cache if regular cache is not found restore-keys: | ${{ runner.os }}-phantomjs-save-${{ inputs.cache-version }} - save-always: true - name: Install PhantomJS if: ${{ steps.phantomjs.outputs.should-install == 'true' }} @@ -84,6 +83,14 @@ runs: } } } + + - name: Save PhantomJS cache + if: ${{ steps.phantomjs.outputs.should-install == 'true' }} + uses: actions/cache/save@v4 + with: + path: ${{ steps.phantomjs.outputs.path }} + key: ${{ runner.os }}-phantomjs-${{ inputs.cache-version }} + - name: End Install PhantomJS group shell: Rscript {0} run: |