GeezerVison is showing github.com — Merge pull request #995 from crazy-max/dev-deps · docker/actions-toolkit@e5d20b9
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/build.yml -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 21 | 21 | node_version: | 22 | 22 | - 24 | 23 | 23 | - 20 | 24 | | - - 18 | 25 | 24 | steps: | 26 | 25 | - | 27 | 26 | name: Build | |
Collapse file Copy file name to clipboardExpand all lines: .github/workflows/test.yml +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | node_version: | 31 | 31 | - 24 | 32 | 32 | - 20 | 33 | | - - 18 | 34 | 33 | steps: | 35 | 34 | - | 36 | 35 | name: Checkout | | 48 | 47 | - | 49 | 48 | name: Check coverage | 50 | 49 | run: | | 51 | | - if [ -f ./coverage/clover.xml ]; then | | 50 | + if [ -f ./coverage/clover.xml ] && [ ! -f ./coverage/allSkipped.txt ]; then | 52 | 51 | echo "RUN_CODECOV=true" >> $GITHUB_ENV | 53 | 52 | else | 54 | 53 | echo "RUN_CODECOV=false" >> $GITHUB_ENV | @@ -218,7 +217,7 @@ jobs: | 218 | 217 | - | 219 | 218 | name: Check coverage | 220 | 219 | run: | | 221 | | - if [ -f ./coverage/clover.xml ]; then | | 220 | + if [ -f ./coverage/clover.xml ] && [ ! -f ./coverage/allSkipped.txt ]; then | 222 | 221 | echo "RUN_CODECOV=true" >> $GITHUB_ENV | 223 | 222 | else | 224 | 223 | echo "RUN_CODECOV=false" >> $GITHUB_ENV | |
Collapse file Copy file name to clipboard +19Lines changed: 19 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 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; |
Collapse file Copy file name to clipboard +59Lines changed: 59 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 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 | +}; |
Collapse file Copy file name to clipboardExpand all lines: package.json +11-11Lines changed: 11 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 66 | 66 | "tmp": "^0.2.5" | 67 | 67 | }, | 68 | 68 | "devDependencies": { | 69 | | - "@eslint/js": "^9.39.2", | | 69 | + "@eslint/js": "^9.39.3", | 70 | 70 | "@types/gunzip-maybe": "^1.4.3", | 71 | 71 | "@types/he": "^1.2.3", | 72 | 72 | "@types/js-yaml": "^4.0.9", | 73 | | - "@types/node": "^20.19.27", | | 73 | + "@types/node": "^20.19.35", | 74 | 74 | "@types/semver": "^7.7.1", | 75 | 75 | "@types/tar-stream": "^3.1.4", | 76 | 76 | "@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", | 80 | 80 | "@vitest/eslint-plugin": "^1.6.9", | 81 | | - "eslint": "^9.39.2", | | 81 | + "eslint": "^9.39.3", | 82 | 82 | "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", | 87 | 87 | "typescript": "^5.9.3", | 88 | | - "vitest": "^3.2.4" | | 88 | + "vitest": "^4.0.18" | 89 | 89 | } | 90 | 90 | } |
Collapse file Copy file name to clipboardExpand all lines: vitest.config.itg.ts +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 15 | 15 | */ | 16 | 16 |
| 17 | 17 | import {defineConfig} from 'vitest/config'; | | 18 | +import {vitestAllSkippedReporter} from './__tests__/.setup/skipped-reporter.mjs'; | 18 | 19 |
| 19 | 20 | export default defineConfig({ | 20 | 21 | test: { | 21 | 22 | clearMocks: true, | 22 | 23 | environment: 'node', | 23 | 24 | include: ['**/*.test.itg.ts'], | 24 | 25 | testTimeout: 1800000, | | 26 | + reporters: ['default', vitestAllSkippedReporter()], | 25 | 27 | coverage: { | 26 | | - all: true, | 27 | 28 | provider: 'v8', | 28 | 29 | reporter: ['clover'], | 29 | 30 | include: ['src/**/*.ts'], | 30 | | - exclude: ['src/**/index.ts'] | | 31 | + exclude: ['src/**/index.ts', '__tests__/**', 'lib/**'] | 31 | 32 | } | 32 | 33 | } | 33 | 34 | }); |
Collapse file Copy file name to clipboardExpand all lines: vitest.config.ts +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 15 | 15 | */ | 16 | 16 |
| 17 | 17 | import {defineConfig} from 'vitest/config'; | | 18 | +import {vitestAllSkippedReporter} from './__tests__/.setup/skipped-reporter.mjs'; | 18 | 19 |
| 19 | 20 | export default defineConfig({ | 20 | 21 | test: { | 21 | 22 | clearMocks: true, | 22 | 23 | environment: 'node', | 23 | 24 | setupFiles: ['./__tests__/.setup/setup.unit.ts'], | 24 | 25 | include: ['**/*.test.ts'], | | 26 | + reporters: ['default', vitestAllSkippedReporter()], | 25 | 27 | coverage: { | 26 | | - all: true, | 27 | 28 | provider: 'v8', | 28 | 29 | reporter: ['clover'], | 29 | 30 | include: ['src/**/*.ts'], | 30 | | - exclude: ['src/**/index.ts'] | | 31 | + exclude: ['src/**/index.ts', '__tests__/**', 'lib/**'] | 31 | 32 | } | 32 | 33 | } | 33 | 34 | }); |
|