Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use actions/cache manually for vcpkg #13176

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

Merged
merged 2 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
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
174 changes: 0 additions & 174 deletions .github/workflows/windows-arm.yml

This file was deleted.

40 changes: 30 additions & 10 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
vc: 2019
vcvars: '10.0.22621.0 -vcvars_ver=14.2'
test_task: check
- os: 11-arm
test_task: 'btest test-basic test-tool' # check and test-spec are broken yet.
target: arm64
- os: 2022
vc: 2019
vcvars: '10.0.22621.0 -vcvars_ver=14.2'
Expand All @@ -63,9 +66,8 @@ jobs:
env:
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
OS_VER: windows-${{ matrix.os < 2022 && '2019' || matrix.os }}
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_DEFAULT_TRIPLET: x64-windows
RUBY_OPT_DIR: D:/a/ruby/ruby/src/vcpkg_installed/%VCPKG_DEFAULT_TRIPLET%
VCPKG_DEFAULT_TRIPLET: ${{ matrix.target || 'x64' }}-windows
RUBY_OPT_DIR: ${{ matrix.os == '11-arm' && 'C' || 'D' }}:/a/ruby/ruby/src/vcpkg_installed/%VCPKG_DEFAULT_TRIPLET%

steps:
- run: md build
Expand All @@ -76,6 +78,7 @@ jobs:
ruby-version: '3.0'
bundler: none
windows-toolchain: none
if: ${{ matrix.os != '11-arm' }}

- name: Install libraries with scoop
run: |
Expand All @@ -85,13 +88,6 @@ jobs:
scoop install vcpkg uutils-coreutils [email protected]
shell: pwsh

- 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 || '');

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
sparse-checkout-cone-mode: false
Expand All @@ -112,6 +108,9 @@ jobs:
for /f "delims=;" %%I in ('%vswhere% -latest -property installationPath') do (
set VCVARS="%%I\VC\Auxiliary\Build\vcvars64.bat"
)
if "${{ matrix.os }}" == "11-arm" (
set VCVARS="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsarm64.bat"
)
set VCVARS
set | uutils sort > old.env
call %VCVARS% ${{ matrix.vcvars || '' }}
Expand All @@ -134,6 +133,13 @@ jobs:
run: Get-Volume
shell: pwsh

# vcpkg built-in cache is not working now
- name: Restore vcpkg artifact
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: C:\Users\runneradmin\AppData\Local\vcpkg\archives
key: vcpkg-${{ matrix.target || 'x64' }}-${{ hashFiles('src/vcpkg.json') }}

- name: Install libraries with vcpkg
run: |
vcpkg install --vcpkg-root=C:\Users\runneradmin\scoop\apps\vcpkg\current
Expand All @@ -156,6 +162,20 @@ jobs:
# But not for this Visual Studio workflow. So here we extract gems before building.
- run: nmake extract-gems

# windows-11-arm runner cannot run `ruby tool/file2lastrev.rb --revision.h --output=revision.h`
- run: |
Set-Content -Path "revision.h" -Value @"
#define RUBY_REVISION "8aedb979da"
#define RUBY_FULL_REVISION "8aedb979da4090116f4fc5a6497f139fd0038881"
#define RUBY_BRANCH_NAME "win-arm"
#define RUBY_RELEASE_DATETIME "2025-04-16T23:18:54Z"
#define RUBY_RELEASE_YEAR 2025
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 17
"@
shell: pwsh
if: ${{ matrix.os == '11-arm' }}

- run: nmake

- name: Set up Launchable
Expand Down
Loading