From ccd52782a11a22ac44f21788266f2308d2f69cd7 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Mon, 7 Nov 2022 01:58:51 -0600 Subject: [PATCH] add next.js ci --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ pages/index.tsx | 6 +++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5029a21 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: Test + +on: + push: + branches: [master] + pull_request: + +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: "16.x" + - name: Install dependencies + run: npm ci + - name: Run next.js build + run: npm run build diff --git a/pages/index.tsx b/pages/index.tsx index ae7966e..410f0be 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,10 +1,10 @@ -import { useAtom, atom, PrimitiveAtom } from "jotai"; +import { useAtom } from "jotai"; import type { NextPage } from "next"; import { useEffect, useRef } from "react"; import { SyntheticEvent, useState } from "react"; import { Form } from "react-bootstrap"; import NumberEditBox from "../components/NumberEditBox"; -import ReceiptItem, { IReceiptItem } from "../components/ReceiptItem"; +import ReceiptItem from "../components/ReceiptItem"; import { moneyFormatter } from "../lib/formatter"; import { ParsedInputDisplay } from "../lib/parseInput"; import { @@ -51,7 +51,7 @@ const Home: NextPage = () => { if (isAddCalled.current) { updateDb(); } - }, [receiptJSONString]); + }, [receiptJSONString, receiptJson]); return (