Skip to content

Commit a400452

Browse files
committed
fix log output
1 parent b31715b commit a400452

File tree

6 files changed

+95
-86
lines changed

6 files changed

+95
-86
lines changed

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ jobs:
5858
# Or pin to a specific CMake version:
5959
# lukka/get-cmake@v3.21.2
6060

61-
# Run vcpkg leveraging its own binary caching integration with GitHub Action
62-
# cache. Since vcpkg.json is being used later on to install the packages
63-
# when `run-cmake` runs, no packages are installed at this time.
61+
# Setup vcpkg: ensures vcpkg is downloaded and built.
62+
# Since vcpkg.json is being used later on to install the packages
63+
# when `run-cmake` runs, no packages are installed at this time
64+
# (and vcpkg does not run).
6465
- name: Setup vcpkg (it does not install any package yet)
6566
uses: lukka/run-vcpkg@v11
6667
#with:
@@ -69,8 +70,8 @@ jobs:
6970
# vcpkgDirectory: '${{ github.workspace }}/vcpkg'
7071

7172
# If not using a submodule for vcpkg sources, this specifies which commit
72-
# id must be checkout from a Git repo. It must not be set if using a
73-
# submodule for vcpkg.
73+
# id must be checkout from a Git repo.
74+
# Note: it must not be set if using a Git submodule for vcpkg.
7475
# vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}'
7576

7677
# This is the glob expression used to locate the vcpkg.json.
@@ -81,7 +82,7 @@ jobs:
8182
# `**/path/from/root/of/repo/to/vcpkg.json` to match the desired `vcpkg.json`.
8283
# vcpkgJsonGlob: '**/vcpkg.json'
8384

84-
# This is only needed if running `vcpkg install` is needed at this step.
85+
# This is only needed if the command `vcpkg install` must run at this step.
8586
# Instead it is highly suggested to let `run-cmake` to run vcpkg later on
8687
# using the vcpkg.cmake toolchain. The default is `false`.
8788
# runVcpkgInstall: true
@@ -123,10 +124,11 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-vcpkg/
123124

124125
```
125126
┌──────────────────────────┐
127+
| Skipped by default. |
126128
│ Compute cache key from: │ Inputs:
127129
│ - vcpkg Git commit │ - `vcpkgGitCommitId`
128-
│ - platform and OS │
129-
└─────────────┬────────────┘
130+
│ - platform and OS │ - `doNotCache`: set to false
131+
└─────────────┬────────────┘ to run this block.
130132
131133
132134
┌─────────────────────────┐ Inputs:
@@ -135,9 +137,10 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-vcpkg/
135137
136138
137139
┌─────────────────────────┐ Inputs:
140+
| Skipped by default. |
138141
│ Restore vcpkg │ - `vcpkgDirectory`
139-
│ from the GH cache
140-
└────────────┬────────────┘
142+
│ from the GH cache. │ - `doNotCache`: set to false
143+
└────────────┬────────────┘ to run this block.
141144
142145
143146
┌─────────────────────────┐
@@ -150,7 +153,7 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-vcpkg/
150153
┌─────────────────────────┐
151154
│ Rebuild vcpkg executable│ Inputs:
152155
│ if not in sync with │ - `vcpkgGitCommitId`
153-
│ sources │ - `vcpkgGitURL`
156+
│ sources. │ - `vcpkgGitURL`
154157
└────────────┬────────────┘
155158
156159
@@ -161,7 +164,7 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-vcpkg/
161164
┌─────────────────────────┐ │
162165
│ Launch `vcpkg install` │ │ Inputs:
163166
│ where vcpkg.json has │ │ - `runVcpkgFormatString`
164-
│ been located │ │ Environment variables:
167+
│ been located. │ │ Environment variables:
165168
└────────────┬────────────┘ │ - `VCPKG_DEFAULT_TRIPLET` is used. If not yet
166169
│ │ set, it is set to the current platform.
167170
│ │ - `VCPKG_INSTALLED_DIR` is used as value for
@@ -171,14 +174,15 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-vcpkg/
171174
┌─────────────────────────┐ │ set, it is set to leverage the GitHub Action
172175
│ Set `VCPKG_ROOT` and │ │ cache storage for Binary Caching artifacts.
173176
│ `VCPKG_DEFAULT_TRIPLET` │ │
174-
│ workflow-wide env vars │ │
177+
│ workflow-wide env vars. │ │
175178
└────────────┬────────────┘ │
176179
├───────────── ┘
177180
178181
┌─────────────────────────┐
179-
│ If no cache-hit, │ Inputs:
180-
│ store vcpkg onto │ - `doNotCache`: disable the caching of the vcpkg
181-
│ GH cache │ executable and its data files.
182+
| Skipped by default. |
183+
│ If no cache-hit, │ Inputs:
184+
│ store vcpkg onto │ - `doNotCache`: set to false to
185+
│ GH cache │ run this block.
182186
└────────────┬────────────┘
183187
|
184188

dist/index.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ class VcpkgAction {
122122
// Ensure vcpkg root is set.
123123
if (!vcpkgRoot) {
124124
vcpkgRoot = yield runvcpkglib.getDefaultVcpkgDirectory(this.baseUtilLib.baseLib);
125-
baseLib.info(`The vcpkg's root directory is not provided, using the predefined: '${this.vcpkgRootDir}'`);
125+
baseLib.info(`The vcpkg's root directory is not provided, using the default value: '${this.vcpkgRootDir}'`);
126126
}
127+
baseLib.info(`The vpckg root directory: '${vcpkgRoot}'`);
127128
// Create the vcpkg_root and cache directory if needed.
128129
const binCachePath = (_a = this.binaryCachePath) !== null && _a !== void 0 ? _a : yield runvcpkglib.getDefaultVcpkgCacheDirectory(this.baseUtilLib.baseLib);
129130
baseLib.debug(`vcpkgRootDir=${this.vcpkgRootDir}, binCachePath=${binCachePath}`);
@@ -136,20 +137,21 @@ class VcpkgAction {
136137
if (!this.vcpkgRootDir) {
137138
throw new Error(`vcpkgRootDir is not defined!`);
138139
}
139-
let vcpkgJsonFilePath = null;
140-
const vcpkgJsonPath = yield vcpkgutil.Utils.getVcpkgJsonPath(this.baseUtilLib, this.vcpkgJsonGlob, this.vcpkgJsonIgnores);
141-
vcpkgJsonFilePath = yield this.getCurrentDirectoryForRunningVcpkg(vcpkgJsonPath);
140+
const vcpkgJsonFilePath = yield this.baseUtilLib.wrapOp(`Searching for vcpkg.json with glob expression '${this.vcpkgJsonGlob}'`, () => __awaiter(this, void 0, void 0, function* () {
141+
const vcpkgJsonPath = yield vcpkgutil.Utils.getVcpkgJsonPath(this.baseUtilLib, this.vcpkgJsonGlob, this.vcpkgJsonIgnores);
142+
return yield this.getCurrentDirectoryForRunningVcpkg(vcpkgJsonPath);
143+
}));
142144
let isCacheHit = null;
143145
let cacheKey = null;
144146
if (this.doNotCache) {
145147
this.baseUtilLib.baseLib.debug(`Skipping restoring vcpkg as caching is disabled. Set input 'doNotCache:false' to enable caching.`);
146148
}
147149
else {
148150
cacheKey =
149-
yield this.baseUtilLib.wrapOp('Compute vcpkg cache key', () => __awaiter(this, void 0, void 0, function* () {
151+
yield this.baseUtilLib.wrapOp('Computing vcpkg cache key', () => __awaiter(this, void 0, void 0, function* () {
150152
const keys = yield vcpkgutil.Utils.computeCacheKeys(this.baseUtilLib, this.vcpkgRootDir, // HACK: if it were not set it would have thrown before.
151153
this.userProvidedCommitId);
152-
if (keys && vcpkgJsonPath) {
154+
if (keys) {
153155
baseLib.info(`Computed key: ${JSON.stringify(keys)}`);
154156
}
155157
else {
@@ -44134,9 +44136,11 @@ class VcpkgRunner {
4413444136
}
4413544137
// If running in a GitHub Runner, enable the GH's cache provider for the vcpkg's binary cache.
4413644138
if (process.env['GITHUB_ACTIONS'] === 'true') {
44137-
// Allow users to define the vcpkg's binary source explicitly in the workflow, in that case don't override it.
44138-
if (!process.env[globals.VCPKG_BINARY_SOURCES])
44139-
this.baseUtils.setVariableVerbose(globals.VCPKG_BINARY_SOURCES, VcpkgRunner.VCPKG_BINARY_SOURCES_GHA);
44139+
yield this.baseUtils.wrapOp(`Setup to run on GitHub Action runners`, () => __awaiter(this, void 0, void 0, function* () {
44140+
// Allow users to define the vcpkg's binary source explicitly in the workflow, in that case don't override it.
44141+
if (!process.env[globals.VCPKG_BINARY_SOURCES])
44142+
this.baseUtils.setVariableVerbose(globals.VCPKG_BINARY_SOURCES, VcpkgRunner.VCPKG_BINARY_SOURCES_GHA);
44143+
}));
4414044144
}
4414144145
// Ensuring `this.vcpkgDestPath` is existent, since is going to be used as current working directory.
4414244146
if (!(yield this.baseUtils.baseLib.exist(this.vcpkgDestPath))) {

package-lock.json

Lines changed: 47 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
"@actions/exec": "^1.1.1",
4444
"@actions/github": "^5.0.3",
4545
"@actions/io": "^1.1.2",
46-
"@lukka/action-lib": "3.5.1",
47-
"@lukka/assets-lib": "3.5.1",
48-
"@lukka/base-lib": "3.5.1",
49-
"@lukka/base-util-lib": "3.5.1",
50-
"@lukka/run-vcpkg-lib": "3.5.1",
46+
"@lukka/action-lib": "3.5.2",
47+
"@lukka/assets-lib": "3.5.2",
48+
"@lukka/base-lib": "3.5.2",
49+
"@lukka/base-util-lib": "3.5.2",
50+
"@lukka/run-vcpkg-lib": "3.5.2",
5151
"@types/adm-zip": "^0.4.32",
5252
"@types/follow-redirects": "^1.14.1",
5353
"@types/jest": "^26.0.14",

0 commit comments

Comments
 (0)