Skip to content

Commit e5d20b9

Browse files
authored
Merge pull request #995 from crazy-max/dev-deps
update dev dependencies
2 parents a45bcd1 + 26ff71b commit e5d20b9

File tree

8 files changed

+350
-541
lines changed

8 files changed

+350
-541
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
node_version:
2222
- 24
2323
- 20
24-
- 18
2524
steps:
2625
-
2726
name: Build

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
node_version:
3131
- 24
3232
- 20
33-
- 18
3433
steps:
3534
-
3635
name: Checkout
@@ -48,7 +47,7 @@ jobs:
4847
-
4948
name: Check coverage
5049
run: |
51-
if [ -f ./coverage/clover.xml ]; then
50+
if [ -f ./coverage/clover.xml ] && [ ! -f ./coverage/allSkipped.txt ]; then
5251
echo "RUN_CODECOV=true" >> $GITHUB_ENV
5352
else
5453
echo "RUN_CODECOV=false" >> $GITHUB_ENV
@@ -218,7 +217,7 @@ jobs:
218217
-
219218
name: Check coverage
220219
run: |
221-
if [ -f ./coverage/clover.xml ]; then
220+
if [ -f ./coverage/clover.xml ] && [ ! -f ./coverage/allSkipped.txt ]; then
222221
echo "RUN_CODECOV=true" >> $GITHUB_ENV
223222
else
224223
echo "RUN_CODECOV=false" >> $GITHUB_ENV
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Copyright 2026 actions-toolkit authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import type {Reporter} from 'vitest/node';
18+
19+
export declare const vitestAllSkippedReporter: () => Reporter;
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/**
2+
* Copyright 2026 actions-toolkit authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import fs from 'node:fs';
18+
import path from 'node:path';
19+
20+
export const vitestAllSkippedReporter = () => {
21+
let vitest;
22+
let hasExecutedTest;
23+
let hasAnyCollectedTest;
24+
25+
const getFlagPath = () => {
26+
const reportsDirectory = vitest?.config?.coverage?.reportsDirectory ?? 'coverage';
27+
return path.join(reportsDirectory, 'allSkipped.txt');
28+
};
29+
30+
return {
31+
onInit(ctx) {
32+
vitest = ctx;
33+
hasExecutedTest = false;
34+
hasAnyCollectedTest = false;
35+
},
36+
onTestCaseReady() {
37+
hasAnyCollectedTest = true;
38+
},
39+
onTestCaseResult(testCase) {
40+
const state = testCase.result()?.state;
41+
if (state === 'passed' || state === 'failed') {
42+
hasExecutedTest = true;
43+
}
44+
},
45+
onTestRunEnd() {
46+
if (!vitest?.config?.coverage?.enabled) {
47+
return;
48+
}
49+
const allSkipped = hasAnyCollectedTest && !hasExecutedTest;
50+
const flagPath = getFlagPath();
51+
if (allSkipped) {
52+
fs.mkdirSync(path.dirname(flagPath), {recursive: true});
53+
fs.writeFileSync(flagPath, '');
54+
} else if (fs.existsSync(flagPath)) {
55+
fs.rmSync(flagPath);
56+
}
57+
}
58+
};
59+
};

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@
6666
"tmp": "^0.2.5"
6767
},
6868
"devDependencies": {
69-
"@eslint/js": "^9.39.2",
69+
"@eslint/js": "^9.39.3",
7070
"@types/gunzip-maybe": "^1.4.3",
7171
"@types/he": "^1.2.3",
7272
"@types/js-yaml": "^4.0.9",
73-
"@types/node": "^20.19.27",
73+
"@types/node": "^20.19.35",
7474
"@types/semver": "^7.7.1",
7575
"@types/tar-stream": "^3.1.4",
7676
"@types/tmp": "^0.2.6",
77-
"@typescript-eslint/eslint-plugin": "^8.50.0",
78-
"@typescript-eslint/parser": "^8.50.0",
79-
"@vitest/coverage-v8": "^3.2.4",
77+
"@typescript-eslint/eslint-plugin": "^8.56.1",
78+
"@typescript-eslint/parser": "^8.56.1",
79+
"@vitest/coverage-v8": "^4.0.18",
8080
"@vitest/eslint-plugin": "^1.6.9",
81-
"eslint": "^9.39.2",
81+
"eslint": "^9.39.3",
8282
"eslint-config-prettier": "^10.1.8",
83-
"eslint-plugin-prettier": "^5.5.4",
84-
"globals": "^14.0.0",
85-
"prettier": "^3.7.4",
86-
"rimraf": "^6.1.2",
83+
"eslint-plugin-prettier": "^5.5.5",
84+
"globals": "^17.3.0",
85+
"prettier": "^3.8.1",
86+
"rimraf": "^6.1.3",
8787
"typescript": "^5.9.3",
88-
"vitest": "^3.2.4"
88+
"vitest": "^4.0.18"
8989
}
9090
}

vitest.config.itg.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@
1515
*/
1616

1717
import {defineConfig} from 'vitest/config';
18+
import {vitestAllSkippedReporter} from './__tests__/.setup/skipped-reporter.mjs';
1819

1920
export default defineConfig({
2021
test: {
2122
clearMocks: true,
2223
environment: 'node',
2324
include: ['**/*.test.itg.ts'],
2425
testTimeout: 1800000,
26+
reporters: ['default', vitestAllSkippedReporter()],
2527
coverage: {
26-
all: true,
2728
provider: 'v8',
2829
reporter: ['clover'],
2930
include: ['src/**/*.ts'],
30-
exclude: ['src/**/index.ts']
31+
exclude: ['src/**/index.ts', '__tests__/**', 'lib/**']
3132
}
3233
}
3334
});

vitest.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@
1515
*/
1616

1717
import {defineConfig} from 'vitest/config';
18+
import {vitestAllSkippedReporter} from './__tests__/.setup/skipped-reporter.mjs';
1819

1920
export default defineConfig({
2021
test: {
2122
clearMocks: true,
2223
environment: 'node',
2324
setupFiles: ['./__tests__/.setup/setup.unit.ts'],
2425
include: ['**/*.test.ts'],
26+
reporters: ['default', vitestAllSkippedReporter()],
2527
coverage: {
26-
all: true,
2728
provider: 'v8',
2829
reporter: ['clover'],
2930
include: ['src/**/*.ts'],
30-
exclude: ['src/**/index.ts']
31+
exclude: ['src/**/index.ts', '__tests__/**', 'lib/**']
3132
}
3233
}
3334
});

0 commit comments

Comments
 (0)