Skip to content

Commit 1095b42

Browse files
update
1 parent 54ccf3d commit 1095b42

File tree

3 files changed

+35
-12
lines changed

3 files changed

+35
-12
lines changed

dist/index.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58387,17 +58387,30 @@ function DeepEqual(a, b) {
5838758387
return true;
5838858388
}
5838958389
async function SetupCCache() {
58390+
let isFound = false;
5839058391
try {
5839158392
await (0, exec_1.exec)('which', ['ccache'], {
58392-
failOnStdErr: true
58393+
silent: true
5839358394
});
58395+
isFound = true;
5839458396
}
5839558397
catch (_a) {
58396-
await (0, exec_1.exec)('brew', ['install', 'ccache']);
58398+
try {
58399+
await (0, exec_1.exec)('brew', ['install', 'ccache']);
58400+
isFound = true;
58401+
}
58402+
catch (_b) {
58403+
core.warning('ccache could not be installed. Proceeding without ccache.');
58404+
}
58405+
}
58406+
if (isFound) {
58407+
process.env.CC = 'ccache clang';
58408+
process.env.CXX = 'ccache clang++';
58409+
core.info('ccache is enabled for Xcode builds.');
58410+
}
58411+
else {
58412+
throw new Error('ccache is not available. Please install ccache to enable caching for Xcode builds.');
5839758413
}
58398-
process.env.CC = 'ccache clang';
58399-
process.env.CXX = 'ccache clang++';
58400-
core.info('ccache is enabled for Xcode builds.');
5840158414
}
5840258415

5840358416

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utilities.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,25 @@ export function DeepEqual(a: any, b: any): boolean {
5353
}
5454

5555
export async function SetupCCache() {
56+
let isFound = false;
5657
try {
5758
await exec('which', ['ccache'], {
58-
failOnStdErr: true
59+
silent: true
5960
});
61+
isFound = true;
6062
} catch {
61-
await exec('brew', ['install', 'ccache']);
63+
try {
64+
await exec('brew', ['install', 'ccache']);
65+
isFound = true;
66+
} catch {
67+
core.warning('ccache could not be installed. Proceeding without ccache.');
68+
}
69+
}
70+
if (isFound) {
71+
process.env.CC = 'ccache clang';
72+
process.env.CXX = 'ccache clang++';
73+
core.info('ccache is enabled for Xcode builds.');
74+
} else {
75+
throw new Error('ccache is not available. Please install ccache to enable caching for Xcode builds.');
6276
}
63-
// Set environment variables for ccache
64-
process.env.CC = 'ccache clang';
65-
process.env.CXX = 'ccache clang++';
66-
core.info('ccache is enabled for Xcode builds.');
6777
}

0 commit comments

Comments
 (0)