Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WAR-25: Add automated testing and code quality checks on PR #28

Merged
merged 3 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "tsconfig.json",
"project": "tsconfig.base.json",
"ecmaFeatures": {
"jsx": true
}
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Code Quality Checks

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
run-test-checks:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Set up Node environment
uses: actions/setup-node@v2
with:
node-version: 18.x

- name: Install dependencies
run: npm ci

- name: Run Jest tests with coverage
run: npm run test

run-lint-checks:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Set up Node environment
uses: actions/setup-node@v2
with:
node-version: 18.x

- name: Install dependencies
run: npm ci

- name: Lint code
run: npm run lint

run-formatting-checks:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Set up Node environment
uses: actions/setup-node@v2
with:
node-version: 18.x

- name: Install dependencies
run: npm ci

- name: Format code
run: npm run format
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"packages/*"
],
"scripts": {
"lint": "eslint --ext .tsx --ext .ts packages/**/src/ --fix --config .eslintrc.json",
"prettier": "npx prettier packages/**/src --write",
"test": "jest --coverage",
"start": "storybook dev -p 6006",
"storybook": "storybook dev -p 6006",
"test": "jest --coverage",
"lint": "eslint --ext .tsx --ext .ts packages/**/src/ --fix --config .eslintrc.json",
"format": "npx prettier packages/**/src --write",
"build:storybook": "storybook build",
"build:warpspeed": "cd packages/warpspeed && rollup -c",
"build:warpspeed-data-viz": "cd packages/warpspeed-data-viz && rollup -c",
Expand Down
2 changes: 1 addition & 1 deletion packages/warpspeed/src/components/modal/modal.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fireEvent, render, act, RenderOptions, RenderResult } from '@testing-library/react';
import { render, RenderOptions, RenderResult } from '@testing-library/react';
import React, { ReactNode } from 'react';
import Modal from './modal';

Expand Down