Skip to content

Commit

Permalink
Add github-binarycache option to use built in cache, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwason committed Jan 18, 2024
1 parent d04310e commit 6c3d4a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
features:

* Simplicity
* Use of a "dry-run" build to generate a unique cache key for the configuration. This guarantees that if packages
change, the cache will be rebuilt, but avoids rebuilding when it isn't necessary.
* Uses vcpkg built-in GitHub caching feature (NEW) OR Use of a "dry-run" build to generate a unique cache key for the configuration.
* Optionally supports reading `vcpkg.json` manifest files

`vcpkg` is cloned to the `${{ github.workspace }}\vcpkg` directory, and the build products are located in
Expand Down Expand Up @@ -37,6 +36,7 @@ Simple usage example:
pkgs: boost-date-time boost-system
triplet: x64-windows-release
token: ${{ github.token }}
github-binarycache: true
```
Simple manifest example:
Expand All @@ -49,6 +49,7 @@ Simple manifest example:
manifest-dir: ${{ github.workspace }} # Set to directory containing vcpkg.json
triplet: x64-windows-release
token: ${{ github.token }}
github-binarycache: true
```
Expand All @@ -75,6 +76,9 @@ Simple manifest example:
token: ''
# Directory containing vcpkg.json manifest file. Cannot be used with pkgs.
manifest-dir: ''
github-binarycache: ''
# "Use vcpkg built-in GitHub binary caching if "true". If not specified, will use the dry-run based file cache."
# Recommended set to "true"

```

Expand Down Expand Up @@ -106,5 +110,6 @@ jobs:
cache-key: ${{ matrix.config.os }}
revision: master
token: ${{ github.token }}
github-binarycache: true
```
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ inputs:
required: false
default: ''
github-binarycache:
description: "GitHub binary cache to use. If not specified, will use the dry-run based file cache."
description: "Use vcpkg built-in GitHub binary caching. If not specified, will use the dry-run based file cache."
required: false
default: ''
outputs:
Expand Down Expand Up @@ -136,7 +136,7 @@ runs:
env:
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
- name: Export GitHub Actions cache environment variables
if: inputs.github-binarycache != 'false'
if: inputs.github-binarycache == 'true' || inputs.github-binarycache == true
uses: actions/github-script@v6
with:
script: |
Expand Down

0 comments on commit 6c3d4a9

Please sign in to comment.