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.

This commit also includes the addition of two badges for Code Climate to the `README.md` file.
  • Loading branch information
Amaro Mariño committed Oct 15, 2023
1 parent 2ac0057 commit b850851
Show file tree
Hide file tree
Showing 9 changed files with 1,663 additions and 12 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/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Bukie

[![Maintainability](https://api.codeclimate.com/v1/badges/38db54aa8cafbb619f02/maintainability)](https://codeclimate.com/github/amalv/bukie/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/38db54aa8cafbb619f02/test_coverage)](https://codeclimate.com/github/amalv/bukie/test_coverage)

This is a showcasing project built with TypeScript and React, styled with Emotion and the Material UI design system. It will include search engine support and filters by year, author, and genre. The project uses Semantic Release for automated versioning and releases, and ESLint for code linting.

The project is a work in progress and will soon include Apollo Client and Apollo Server to showcase GraphQL integration. The goal of this project is to demonstrate the use of different technologies in a real-world application.
Expand Down
Loading

0 comments on commit b850851

Please sign in to comment.