Skip to content

Commit

Permalink
feat: add support for Code Climate GitHub Action and React Testing Li…
Browse files Browse the repository at this point in the history
…brary

This commit adds support for the Code Climate GitHub Action and React Testing Library to the project.

The `codeclimate.yml` file has been updated to include a `codeclimate` job that runs tests and generates a coverage report using `npm` and `vitest`, and uploads the coverage report to Code Climate using the `paambaati/codeclimate-action` GitHub Action.

The `coverage` directory has also been added to the `.gitignore` file to prevent test coverage reports from being committed to the repository.

In addition, a test for the `App` component has been added to `src/App.test.tsx` using React Testing Library.
  • Loading branch information
Amaro Mariño committed Oct 15, 2023
1 parent 2ac0057 commit c1853e2
Show file tree
Hide file tree
Showing 7 changed files with 1,660 additions and 11 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Code Climate

on: push
jobs:
codeclimate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Test & publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: "npm run coverage"
coverageLocations: |
${github.workspace}/coverage/clover.xml:clover
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Test coverage reports directory
coverage/
Loading

0 comments on commit c1853e2

Please sign in to comment.