mirror of
https://github.com/Mozilla-Actions/sccache-action.git
synced 2026-04-08 17:42:13 +08:00
add disable_annotations options to disable stats report (#162)
This commit is contained in:
25
.github/workflows/CI.yml
vendored
25
.github/workflows/CI.yml
vendored
@@ -71,3 +71,28 @@ jobs:
|
|||||||
- name: Run sccache for check
|
- name: Run sccache for check
|
||||||
shell: bash
|
shell: bash
|
||||||
run: ${SCCACHE_PATH} --start-server
|
run: ${SCCACHE_PATH} --start-server
|
||||||
|
|
||||||
|
test_disable_annotations:
|
||||||
|
name: Test disable_annotations version
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 18.x
|
||||||
|
cache: npm
|
||||||
|
|
||||||
|
- name: npm install
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Run sccache-cache
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
disable_annotations: true
|
||||||
|
|
||||||
|
- name: Run sccache for check
|
||||||
|
shell: bash
|
||||||
|
run: ${SCCACHE_PATH} --start-server
|
||||||
|
|||||||
@@ -52,6 +52,15 @@ Note that using the previous declaration will automatically create a
|
|||||||
run: ${SCCACHE_PATH} --show-stats
|
run: ${SCCACHE_PATH} --show-stats
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### disable stats report
|
||||||
|
|
||||||
|
```
|
||||||
|
- name: Run sccache-cache
|
||||||
|
uses: mozilla-actions/sccache-action@v0.0.6
|
||||||
|
with:
|
||||||
|
disable_annotations: true
|
||||||
|
```
|
||||||
|
|
||||||
### Rust code
|
### Rust code
|
||||||
|
|
||||||
For Rust code, the following environment variables should be set:
|
For Rust code, the following environment variables should be set:
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ inputs:
|
|||||||
token:
|
token:
|
||||||
description: "Used to pull the latest release from sccache. When running this action outside of github.com, you have to pass a personal access token for github.com."
|
description: "Used to pull the latest release from sccache. When running this action outside of github.com, you have to pass a personal access token for github.com."
|
||||||
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
|
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
|
||||||
|
disable_annotations:
|
||||||
|
description: "Disable annotation generation in post-run."
|
||||||
|
default: 'false'
|
||||||
runs:
|
runs:
|
||||||
using: "node20"
|
using: "node20"
|
||||||
main: "dist/setup/index.js"
|
main: "dist/setup/index.js"
|
||||||
|
|||||||
2
dist/show_stats/index.js
vendored
2
dist/show_stats/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -29,6 +29,12 @@ async function get_output(command: string, args: string[]): Promise<string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function show_stats() {
|
async function show_stats() {
|
||||||
|
const disable_annotations = core.getBooleanInput('disable_annotations');
|
||||||
|
if (disable_annotations) {
|
||||||
|
core.debug('annotations generation disabled');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
core.debug('start sccache show starts');
|
core.debug('start sccache show starts');
|
||||||
const human_stats = await core.group('Get human-readable stats', async () => {
|
const human_stats = await core.group('Get human-readable stats', async () => {
|
||||||
return get_output(`${process.env.SCCACHE_PATH}`, ['--show-stats']);
|
return get_output(`${process.env.SCCACHE_PATH}`, ['--show-stats']);
|
||||||
|
|||||||
Reference in New Issue
Block a user