Skip to content

Commit

Permalink
vcpkg binary cache to external webserver experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
negrutiu committed Oct 7, 2024
1 parent 58ade5a commit 4dd8cfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,24 @@ jobs:
repository: 'Microsoft/vcpkg'
path: vcpkg/repository

# Use `GitHub Actions Cache` (x-gha) as vcpkg binary cache provider
# Cache entries are removed 7d after the last cache hit
# https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache
# We'll use `x-gha,readwrite` as vcpkg binary cache provider, which requires ACTIONS_CACHE_URL and ACTIONS_RUNTIME_TOKEN envvars
# note: Github Actions cache entries are removed after 7d
# - name: Export GitHub Actions cache environment variables
# uses: actions/github-script@v7
# with:
# script: |
# core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
# core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

# https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching
# Use an external web server as vcpkg binary cache provider
# https://learn.microsoft.com/en-us/vcpkg/reference/binarycaching
- name: Export vcpkg cache server variables
env:
VCPKG_BINARY_CACHE_URL: ${{secrets.VCPKG_BINARY_CACHE_URL}}
VCPKG_BINARY_CACHE_AUTH_HEADER: ${{secrets.VCPKG_BINARY_CACHE_AUTH_HEADER}}
uses: actions/github-script@v7
with:
script: |
core.exportVariable('VCPKG_BINARY_CACHE_URL', process.env.VCPKG_BINARY_CACHE_URL || '');
core.exportVariable('VCPKG_BINARY_CACHE_AUTH_HEADER', process.env.VCPKG_BINARY_CACHE_AUTH_HEADER || '');
core.exportVariable('VCPKG_BINARY_CACHE_URL', ${{secrets.VCPKG_BINARY_CACHE_URL}} || '');
core.exportVariable('VCPKG_BINARY_CACHE_AUTH_HEADER', ${{secrets.VCPKG_BINARY_CACHE_AUTH_HEADER}} || '');
# -----------------------------------------------------------------------
- name: Build
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/experiments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ jobs:
py -3 -V
py -3 -m pip list
- name: External storage
env:
CACHE_SERVER_URL: ${{secrets.CACHE_SERVER_URL}}
CACHE_SERVER_USER: ${{secrets.CACHE_SERVER_USER}}
CACHE_SERVER_PASS: ${{secrets.CACHE_SERVER_PASS}}
shell: cmd
run: |
echo CACHE_SERVER_URL = %CACHE_SERVER_URL%
echo CACHE_SERVER_USER = %CACHE_SERVER_USER%
echo CACHE_SERVER_PASS = %CACHE_SERVER_PASS%
if defined CACHE_SERVER_URL echo -- CACHE_SERVER_URL is defined
if not defined CACHE_SERVER_URL echo -- CACHE_SERVER_URL is not defined
if defined CACHE_SERVER_URL2 echo -- CACHE_SERVER_URL2 is defined
if not defined CACHE_SERVER_URL2 echo -- CACHE_SERVER_URL2 is not defined
# [note] Pulls latest mingw-w64 (14.2.0) using msys2/pacman
# [note] Quite slow (4-5m)
# - name: Setup msys2/mingw32
Expand Down

0 comments on commit 4dd8cfe

Please sign in to comment.