diff --git a/.github/workflows/badget.yml b/.github/workflows/badget.yml new file mode 100644 index 0000000..eb75355 --- /dev/null +++ b/.github/workflows/badget.yml @@ -0,0 +1,27 @@ +name: main + +on: + push: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm ci + - run: npm run test + env: + GIST_TOKEN: ${{ secrets.GIST_SECRET }} + - run: npm run build + - run: sed -i '0,/index.js/s//dist\/index.js/' action.yml package.json + - run: rm -rf test/data + - uses: ./ + with: + gist-id: ${{ secrets.GIST_ID }} + token: ${{ secrets.GIST_SECRET }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a9b595c..4dfb56a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,6 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build --if-present + - run: npm run format + - run: npm run lint - run: npm test diff --git a/.gitignore b/.gitignore index c6bba59..e6e50f1 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,5 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* + +**/*/junit.xml \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index c44ef36..cb933b0 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,4 +4,5 @@ export default { transform: { "^.+.tsx?$": ["ts-jest", {}], }, + "reporters": ["default", "jest-junit"] }; diff --git a/package-lock.json b/package-lock.json index 8ce2a2d..a2cfbdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "eslint": "^9.15.0", "eslint-plugin-react": "^7.37.2", "globals": "^15.12.0", + "jest-junit": "^16.0.0", "prettier": "3.3.3", "ts-jest": "^29.2.5", "typescript-eslint": "^8.15.0" @@ -1697,7 +1698,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "peer": true, "engines": { "node": ">=8" } @@ -4429,6 +4429,21 @@ "fsevents": "^2.3.2" } }, + "node_modules/jest-junit": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-16.0.0.tgz", + "integrity": "sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2", + "xml": "^1.0.1" + }, + "engines": { + "node": ">=10.12.0" + } + }, "node_modules/jest-leak-detector": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", @@ -5094,6 +5109,18 @@ "node": "*" } }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -6113,7 +6140,6 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "peer": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -6514,6 +6540,15 @@ "punycode": "^2.1.0" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", @@ -6684,6 +6719,12 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/xml": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", + "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", + "dev": true + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index ba44ed9..d109b0f 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,10 @@ "scripts": { "build": "tsc", "clean": "rm -rf dist", - "format": "prettier . --write", - "lint": "eslint . --fix", + "format": "prettier .", + "format:fix": "prettier . --write", + "lint": "eslint .", + "lint:fix": "eslint . --fix", "test": "jest" }, "engines": { @@ -47,6 +49,7 @@ "eslint": "^9.15.0", "eslint-plugin-react": "^7.37.2", "globals": "^15.12.0", + "jest-junit": "^16.0.0", "prettier": "3.3.3", "ts-jest": "^29.2.5", "typescript-eslint": "^8.15.0"