From 9ea8f3fda8c79ec6b5c685b79043a0146d4a6a97 Mon Sep 17 00:00:00 2001 From: Sebastian Fastner Date: Tue, 23 Jul 2024 16:12:06 +0200 Subject: [PATCH] feat: add test for every push --- .github/workflows/github-actions-test.yml | 16 ++++++++++++++++ app/components/banner/Banner.tsx | 4 +++- app/components/card/Card.css.ts | 1 + package.json | 7 ++++--- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/github-actions-test.yml diff --git a/.github/workflows/github-actions-test.yml b/.github/workflows/github-actions-test.yml new file mode 100644 index 0000000..b87e5a9 --- /dev/null +++ b/.github/workflows/github-actions-test.yml @@ -0,0 +1,16 @@ +name: GitHub Actions Prod Deployment +on: + - push + +jobs: + Test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: corepack enable + - run: pnpm i + - run: pnpm test + - run: pnpm build diff --git a/app/components/banner/Banner.tsx b/app/components/banner/Banner.tsx index 3065f07..a061efe 100644 --- a/app/components/banner/Banner.tsx +++ b/app/components/banner/Banner.tsx @@ -3,7 +3,9 @@ import type { PropsWithChildren } from "react" import { contentClass, rootClass } from "./Banner.css" export interface BannerProps extends PropsWithChildren { - // readonly title: string + // TODO: how to remove react/no-unused-prop-types + // eslint-disable-next-line react/no-unused-prop-types + readonly title: string } export function Banner({ children }: BannerProps) { diff --git a/app/components/card/Card.css.ts b/app/components/card/Card.css.ts index d3aafd0..ff8eec4 100644 --- a/app/components/card/Card.css.ts +++ b/app/components/card/Card.css.ts @@ -7,6 +7,7 @@ import { elenaWebfont } from "../fonts/elena/Elena.css" export const root = style({ width: "40ch", border: "1px solid", + // TODO: how to remove no-unsafe-assignment // eslint-disable-next-line @typescript-eslint/no-magic-numbers background: `radial-gradient(at right bottom, ${goldShades[3]}, white)`, borderColor: "white", diff --git a/package.json b/package.json index 6c83dfd..9d8703a 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,12 @@ "sideEffects": false, "type": "module", "scripts": { - "check-types": "tsc", - "lint": "eslint .", + "test": "pnpm run --parallel /test:/", + "test:check-types": "tsc --noEmit", + "test:lint": "eslint .", "fix": "eslint --fix .; prettier --write .", "format": "prettier --write .", - "check-format": "prettier --check .", + "test:check-format": "prettier --check .", "build": "remix vite:build", "dev": "remix vite:dev", "start": "remix-serve ./build/server/index.js",