Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use cache GHA restore/save for PhantomJS #40

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions setup-phantomjs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand All @@ -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: |
Expand Down