Skip to content

Commit

Permalink
Modernize usage of Vcpkg in CI
Browse files Browse the repository at this point in the history
Use Vcpkg's manifest mode.
  • Loading branch information
dimztimz committed May 11, 2023
1 parent 1ae818e commit 94b2c1d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,14 @@ jobs:
run: |
echo "local_app_data=$LOCALAPPDATA" >> $GITHUB_ENV
echo "vcpkg_root=$VCPKG_INSTALLATION_ROOT" >> $GITHUB_ENV
vcpkg search icu | awk '$1=="icu"{ print "icu_ver="$2 }' >> $GITHUB_ENV
- uses: actions/cache@v3
with:
# use backslashes in path here for Windows.
path: ${{ env.local_app_data }}\vcpkg\archives
key: windows-vcpkg-cache-${{ env.icu_ver }}
key: windows-vcpkg-cache-${{ hashFiles('vcpkg.json') }}
restore-keys: windows-vcpkg-cache-

- name: Pull Vcpkg dependencies
run: vcpkg install icu getopt --triplet=x64-windows

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
env:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ manuals.
1. Install Visual Studio 2017 or newer. Alternatively, you can use
Visual Studio Build Tools.
2. Install Git for Windows and Cmake.
3. Install vcpkg in some folder, e.g. in `c:\vcpkg`.
4. Run `vcpkg install icu getopt --triplet=x64-windows`.
5. Run the commands bellow.
3. Install Vcpkg in some folder, e.g. in `c:\vcpkg`.
4. Run the commands bellow. Vcpkg will work in manifest mode and it will
automatically install the dependencies.

<!-- end list -->

Expand Down
17 changes: 17 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"builtin-baseline": "2f9972005f61f02fa3cda7fc062d1b834b534b8d",
"dependencies": [
{
"name": "catch2",
"version>=": "2.13.9"
},
{
"name": "getopt",
"version>=": "0#2"
},
{
"name": "icu",
"version>=": "69.1#18"
}
]
}

0 comments on commit 94b2c1d

Please sign in to comment.