From df5070b166f6415d0ea5cd486595dd7a42b56f60 Mon Sep 17 00:00:00 2001 From: Ajoy Kumar Das Date: Sat, 20 Jan 2024 12:59:23 +0530 Subject: [PATCH 1/8] setup:github-actions --- .github/workflows/continuous-integration.yml | 29 ++++++++++++++++++++ package.json | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/continuous-integration.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..4699326 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,29 @@ +# For more information see: https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions + +name: Continuous Integration + +on: + pull_request: + branches: ["*"] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + timeout-minutes: 20 + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + # TODO: setup prettier + # - run: yarn prettier --check + - run: yarn test:coverage + - run: yarn build diff --git a/package.json b/package.json index 13fb9c9..3deac94 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "build:production": "cp ./env/.env.production .env && next build", "start": "next start", "test": "jest --watch", + "test:coverage": "jest --coverage", "lint": "next lint", + "build": "next build", "build:staging": "cp ./env/.env.staging .env && next build", "coverage": "jest --collect-coverage" }, From a7b9e8ea9d5f95cfb09150f7e65b4b6649c3c291 Mon Sep 17 00:00:00 2001 From: Ajoy Kumar Das Date: Sat, 20 Jan 2024 14:02:09 +0530 Subject: [PATCH 2/8] upgrade:use latest version of actions --- .github/workflows/continuous-integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4699326..3bd7cd5 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -17,9 +17,9 @@ jobs: timeout-minutes: 20 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: yarn From 03c22da8bee5cde4c3b59d95e7fbbba01e785724 Mon Sep 17 00:00:00 2001 From: Ajoy Kumar Das Date: Sat, 20 Jan 2024 14:37:00 +0530 Subject: [PATCH 3/8] add prettier to github actions --- .github/workflows/continuous-integration.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3bd7cd5..fe8172d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -23,7 +23,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: yarn - # TODO: setup prettier - # - run: yarn prettier --check + - run: yarn prettier:check - run: yarn test:coverage - run: yarn build From c40d204f7f81071441f73e63865855265c8db676 Mon Sep 17 00:00:00 2001 From: Ajoy Kumar Das Date: Sat, 20 Jan 2024 15:08:20 +0530 Subject: [PATCH 4/8] chore:fix prettier problem --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fe8172d..8d7415b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -4,7 +4,7 @@ name: Continuous Integration on: pull_request: - branches: ["*"] + branches: ['*'] jobs: build: From cf7494da2b701bdb37c9c9c7f7b50bb72bac7c89 Mon Sep 17 00:00:00 2001 From: Ajoy Kumar Das Date: Sat, 20 Jan 2024 15:10:38 +0530 Subject: [PATCH 5/8] chore:fix-tsconfig prettier issues --- tsconfig.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 5f09f7e..52d129f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,9 +16,9 @@ "incremental": true, "baseUrl": "./", "paths": { - "@/*": ["./*"] - } + "@/*": ["./*"], + }, }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "pages/_document.js"], - "exclude": ["node_modules"] + "exclude": ["node_modules"], } From fa5f4b236459f00e3438e6c3bda21353fae4d4d3 Mon Sep 17 00:00:00 2001 From: Ajoy Kumar Das Date: Sat, 20 Jan 2024 15:53:58 +0530 Subject: [PATCH 6/8] chore: try fix failing tests --- tsconfig.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 52d129f..5f09f7e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,9 +16,9 @@ "incremental": true, "baseUrl": "./", "paths": { - "@/*": ["./*"], - }, + "@/*": ["./*"] + } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "pages/_document.js"], - "exclude": ["node_modules"], + "exclude": ["node_modules"] } From d9b0bbd1f1d881a541e461df2427ce9c8eef208c Mon Sep 17 00:00:00 2001 From: Ajoy Kumar Das Date: Sat, 20 Jan 2024 15:59:43 +0530 Subject: [PATCH 7/8] test: fix test --- .prettierignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index fd3bd29..9123330 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,4 +5,6 @@ node_modules/ /coverage/* # Ignore all files in the .next directory -/.next/* \ No newline at end of file +/.next/* + +tsconfig.json \ No newline at end of file From e58308c52bef92e3480f95f7bdffb65631c19f4d Mon Sep 17 00:00:00 2001 From: Ajoy Kumar Das Date: Sat, 20 Jan 2024 16:05:29 +0530 Subject: [PATCH 8/8] revert commit --- .prettierignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.prettierignore b/.prettierignore index 9123330..fd3bd29 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,6 +5,4 @@ node_modules/ /coverage/* # Ignore all files in the .next directory -/.next/* - -tsconfig.json \ No newline at end of file +/.next/* \ No newline at end of file