mirror of
https://github.com/mozilla-actions/sccache-action
synced 2026-09-14 20:13:56 +00:00
+13
-12
@@ -13,23 +13,24 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {exec} from 'child_process';
|
import * as exec from '@actions/exec';
|
||||||
|
|
||||||
async function show_stats() {
|
async function show_stats() {
|
||||||
core.debug('start sccache show starts');
|
core.debug('start sccache show starts');
|
||||||
|
|
||||||
exec(
|
const defaultListener = {
|
||||||
`${process.env.SCCACHE_PATH} --show-stats`,
|
stdout: (data: Buffer) => {
|
||||||
(err: any, stdout: any, stderr: any) => {
|
stdout.push(data.toString());
|
||||||
core.info(stdout);
|
|
||||||
core.warning(stderr);
|
|
||||||
|
|
||||||
if (err) {
|
|
||||||
core.error('failed to show sccache stats');
|
|
||||||
throw new Error(err);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
};
|
||||||
|
|
||||||
|
const stdout: string[] = [];
|
||||||
|
|
||||||
|
await exec.exec(`${process.env.SCCACHE_PATH}`, ['--show-stats'], {
|
||||||
|
listeners: defaultListener
|
||||||
|
});
|
||||||
|
|
||||||
|
core.info(stdout.join(''));
|
||||||
}
|
}
|
||||||
|
|
||||||
show_stats().catch(err => {
|
show_stats().catch(err => {
|
||||||
|
|||||||
Reference in New Issue
Block a user