ci: remove restore-keys for vcpkg and use local bootstrap
This commit is contained in:
parent
b904cba040
commit
dafd20e182
3 changed files with 9 additions and 7 deletions
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
|
|
@ -68,10 +68,9 @@ jobs:
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
|
vcpkg
|
||||||
vcpkg_installed
|
vcpkg_installed
|
||||||
${{ env.LOCALAPPDATA }}/vcpkg
|
|
||||||
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
|
key: vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json', 'vcpkg-configuration.json') }}
|
||||||
restore-keys: vcpkg-${{ runner.os }}
|
|
||||||
|
|
||||||
# Should only restore the .venv directory from cache.
|
# Should only restore the .venv directory from cache.
|
||||||
- name: Init Python venv
|
- name: Init Python venv
|
||||||
|
|
@ -98,6 +97,8 @@ jobs:
|
||||||
uses: seanmiddleditch/gha-setup-ninja@master
|
uses: seanmiddleditch/gha-setup-ninja@master
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
env:
|
||||||
|
VCPKG_ROOT: "" # Unset deliberately to suppress 'already installed' warning.
|
||||||
run: python ./scripts/install_deps.py
|
run: python ./scripts/install_deps.py
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ def install(args):
|
||||||
if env.is_windows() and not args.skip_vcpkg:
|
if env.is_windows() and not args.skip_vcpkg:
|
||||||
import lib.vcpkg as vcpkg
|
import lib.vcpkg as vcpkg
|
||||||
|
|
||||||
vcpkg.install()
|
vcpkg.install(args.ci_env)
|
||||||
|
|
||||||
if not args.skip_meson:
|
if not args.skip_meson:
|
||||||
if args.subprojects:
|
if args.subprojects:
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,15 @@ import lib.cmd_utils as cmd_utils
|
||||||
GIT_REPO = "https://github.com/microsoft/vcpkg.git"
|
GIT_REPO = "https://github.com/microsoft/vcpkg.git"
|
||||||
|
|
||||||
|
|
||||||
def install():
|
def install(ci_env):
|
||||||
vcpkg_bin = ensure_vcpkg()
|
vcpkg_bin = ensure_vcpkg(ci_env)
|
||||||
|
|
||||||
cmd_utils.run([vcpkg_bin, "install"], print_cmd=True)
|
cmd_utils.run([vcpkg_bin, "install"], print_cmd=True)
|
||||||
|
|
||||||
|
|
||||||
def ensure_vcpkg():
|
def ensure_vcpkg(ci_env):
|
||||||
if cmd_utils.has_command("vcpkg"):
|
# Don't use the local vcpkg if we're in CI, since this makes caching complicated.
|
||||||
|
if not ci_env and cmd_utils.has_command("vcpkg"):
|
||||||
print("Using system vcpkg")
|
print("Using system vcpkg")
|
||||||
return "vcpkg"
|
return "vcpkg"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue