diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c341ba79..2a9067ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,8 +42,17 @@ jobs: - name: Test (with coverage) run: pnpm test:coverage + - name: Test (with report) + run: pnpm test:report + - uses: codecov/codecov-action@v5 with: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} verbose: true + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 772241d2..2c47e783 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ coverage ts-build-cache tsconfig.tsbuildinfo + +junit.xml diff --git a/commitlint.config.js b/commitlint.config.js index f45058fc..462095be 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,4 +1,4 @@ -module.exports = { +export default { extends: ['@commitlint/config-conventional'], parserPreset: { parserOpts: { diff --git a/lint-staged.config.js b/lint-staged.config.js index 6278bee7..b70d6e63 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,4 +1,4 @@ -module.exports = { +export default { '*': [ 'biome check', // Format, sort imports, lint, and apply safe fixes ], diff --git a/package.json b/package.json index 6dbad175..d29f4680 100644 --- a/package.json +++ b/package.json @@ -13,11 +13,12 @@ "biome:fix": "biome lint --write", "format": "biome format --write", "lint": "biome lint", - "prerelease": "cross-env NODE_ENV=production pnpm auth && pnpm build", + "prerelease": "pnpm auth && pnpm build", "release": "changeset publish", "setup": "husky install && preconstruct dev && manypkg check && check-node-version --package --print", - "test:coverage": "cross-env NODE_ENV=test npm test -- --coverage", - "test": "cross-env NODE_ENV=test vitest run", + "test:coverage": "vitest --coverage", + "test:report": "vitest --reporter=junit --outputFile=junit.xml", + "test": "vitest", "typecheck": "tsc --build" }, "author": "Tobias Deekens ", @@ -26,6 +27,7 @@ "npm": ">=10", "pnpm": ">=9" }, + "type": "module", "bugs": { "url": "https://github.com/tdeekens/promster/issues" }, @@ -59,7 +61,6 @@ "@types/semver": "7.5.8", "@vitest/coverage-v8": "2.1.5", "check-node-version": "4.2.1", - "cross-env": "7.0.3", "husky": "9.0.11", "lint-staged": "15.2.10", "rimraf": "5.0.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b566b98..b5d6a012 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,9 +53,6 @@ importers: check-node-version: specifier: 4.2.1 version: 4.2.1 - cross-env: - specifier: 7.0.3 - version: 7.0.3 husky: specifier: 9.0.11 version: 9.0.11 @@ -2517,11 +2514,6 @@ packages: typescript: optional: true - cross-env@7.0.3: - resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} - engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} - hasBin: true - cross-inspect@1.0.1: resolution: {integrity: sha512-Pcw1JTvZLSJH83iiGWt6fRcT+BjZlCDRVwYLbUcHzv/CRpB7r0MlSrGbIyQvVSNyGnbt7G4AXuyCiDR3POvZ1A==} engines: {node: '>=16.0.0'} @@ -7368,10 +7360,6 @@ snapshots: optionalDependencies: typescript: 5.6.2 - cross-env@7.0.3: - dependencies: - cross-spawn: 7.0.3 - cross-inspect@1.0.1: dependencies: tslib: 2.6.3