diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..33ffe95 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: CI +on: [push] +# Simple CI/CD for building +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + + - name: Run install + uses: borales/actions-yarn@v4 + with: + cmd: install # will run `yarn install` command + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # if needed + - name: Run prisma push + uses: borales/actions-yarn@v4 + with: + cmd: prisma:generate + + - name: Build production bundle + uses: borales/actions-yarn@v4 + with: + cmd: build # will run `yarn build:prod` command \ No newline at end of file diff --git a/src/hooks/useQuestions.ts b/src/hooks/useQuestions.ts index 9353cf6..6d79037 100644 --- a/src/hooks/useQuestions.ts +++ b/src/hooks/useQuestions.ts @@ -19,7 +19,7 @@ type UseQuestionsReturn = { /** * Submits code with the given language and number */ - runSelecteTestCase: (code: string) => void; + runSelectedTestCase: (code: string) => void; /** * Indicates if the submitted code is still running */ @@ -141,7 +141,7 @@ export default function useQuestions(): UseQuestionsReturn { output, questionTitleList: questions, currentQuestion: question.data, - runSelecteTestCase(code) { + runSelectedTestCase(code) { if (questionId && environmentId && testCaseId) { runTestCase.mutate({ testCaseId, source_code: code }); } else { diff --git a/src/pages/collab/rooms/[id].tsx b/src/pages/collab/rooms/[id].tsx index 671bab7..026492c 100644 --- a/src/pages/collab/rooms/[id].tsx +++ b/src/pages/collab/rooms/[id].tsx @@ -225,7 +225,7 @@ const Room = () => { function runTest() { // run test - useQuestionObject.runSelecteTestCase(codeSession[0].toString()); + useQuestionObject.runSelectedTestCase(codeSession[0].toString()); } return (