diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml new file mode 100644 index 0000000..d0a8145 --- /dev/null +++ b/.github/workflows/ui.yml @@ -0,0 +1,37 @@ +name: UI-claudio-coder page +run-name: ${{github.actor}} is running UI-claudio-coder +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + UI-claudio-coder: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Linters + run: npm run lint + + - name: Format Code + run: npm run format + + - name: Unit Test + run: npm run test:coverage + + - name: 'Report Coverage' + uses: davelosert/vitest-coverage-report-action@v2 diff --git a/package.json b/package.json index d9f6c19..3d87a4f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "format": "prettier --check .", "format:fix": "prettier --write .", "test": "vitest", - "test:coverage": "vitest --coverage" + "test:coverage": "vitest --coverage.enabled true" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.5.1", diff --git a/vitest.config.ts b/vitest.config.ts index 9894732..6460f1f 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -24,6 +24,7 @@ export default defineConfig({ environment: 'jsdom', coverage: { provider: 'v8', + reporter: ['text', 'html', 'clover', 'json-summary', 'json'], exclude: [ 'vitest.config.ts', '**/*.config.*', @@ -31,6 +32,12 @@ export default defineConfig({ '__mocks__', ...coverageConfigDefaults.exclude, ], + thresholds: { + lines: 80, + branches: 80, + functions: 80, + statements: 80, + }, }, setupFiles: ['vitest.setup.ts'], watch: false,