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

fix + ci: fix table type + setup unit test ci #130

Merged
merged 5 commits into from
Nov 28, 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
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ jobs:
vector --version
- name: Run lint + type check
run: make ci-lint
unit:
timeout-minutes: 8
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install root dependencies
uses: bahmutov/npm-install@v1
- name: Run unit tests
run: make ci-unit
integration:
timeout-minutes: 8
runs-on: ubuntu-20.04
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ dev-down:

.PHONY: dev-lint
dev-lint:
./docker/ingestor/run_linting.sh && yarn workspaces run lint
./docker/ingestor/run_linting.sh && npx nx run-many -t lint

.PHONY: ci-lint
ci-lint:
./docker/ingestor/run_linting.sh && yarn workspaces run ci:lint
./docker/ingestor/run_linting.sh && npx nx run-many -t ci:lint

.PHONY: dev-int
dev-int:
Expand All @@ -40,6 +40,14 @@ dev-int:
ci-int:
docker compose -p int -f ./docker-compose.ci.yml run --rm api ci:int

.PHONY: dev-unit
dev-unit:
npx nx run-many -t dev:unit

.PHONY: ci-unit
ci-unit:
npx nx run-many -t ci:unit

.PHONY: build-local
build-local:
docker build ./docker/hostmetrics -t ${IMAGE_NAME}:${LATEST_VERSION}-hostmetrics --target prod &
Expand Down
4 changes: 2 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"build": "next build",
"start": "next start",
"lint": "eslint . --ext .ts,.tsx",
"ci:lint": "yarn lint",
"ci:unit": "jest --coverage"
"ci:lint": "yarn lint && yarn tsc --noEmit",
"ci:unit": "jest --ci --coverage"
},
"dependencies": {
"@hyperdx/browser": "^0.18.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { UNDEFINED_WIDTH } from '../tableUtils';

import styles from './Table.module.scss';

type TableProps<T extends Record<string, unknown>> = {
type TableProps<T extends Record<string, unknown> | string[]> = {
data?: T[];
columns: ColumnDef<T>[];
emptyMessage?: string;
Expand All @@ -20,7 +20,7 @@ type TableProps<T extends Record<string, unknown>> = {
interactive?: boolean;
};

export const Table = <T extends Record<string, unknown>>({
export const Table = <T extends Record<string, unknown> | string[]>({
data = [],
columns,
emptyMessage,
Expand Down
Loading