From 8917f78fb512f61667aa2f89f80429cf296d034b Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 22:56:40 +0200 Subject: [PATCH 01/27] actions: add github actions workflows --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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..6621e63 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + paths-ignore: + - '*.md' + + pull_request: + paths-ignore: + - '*.md' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install Dependencies + run: | + npm install --ignore-scripts + - name: Run Tests + run: | + npm run test:unit From 085f38784dc733cd722c49255ec3ef39f2e33134 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:11:33 +0200 Subject: [PATCH 02/27] fix run command --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6621e63..49441b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,18 +11,18 @@ on: jobs: test: + runs-on: ubuntu-latest - steps: + + steps: - uses: actions/checkout@v3 - name: Use Node.js uses: actions/setup-node@v3 with: node-version: 16 - + - name: Install Dependencies - run: | - npm install --ignore-scripts + run: npm install --ignore-scripts - name: Run Tests - run: | - npm run test:unit + run: npm run test:unit From 98d3925d6edc27bba06ef20a2c997a489dc1ca38 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:12:54 +0200 Subject: [PATCH 03/27] remove ignore scripts --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49441b9..5f62d77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,6 @@ jobs: node-version: 16 - name: Install Dependencies - run: npm install --ignore-scripts + run: npm install - name: Run Tests run: npm run test:unit From c185ba718748a20add085d3c03f238cdc4f51a0e Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:18:31 +0200 Subject: [PATCH 04/27] fix install deps --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f62d77..5c4c9b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,5 +24,6 @@ jobs: - name: Install Dependencies run: npm install + - name: Run Tests run: npm run test:unit From d3f0fa067ae327b8064fd5c2b796c6f59c4fb1ed Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:20:44 +0200 Subject: [PATCH 05/27] fix install deps --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c4c9b2..b04c4fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,8 @@ jobs: node-version: 16 - name: Install Dependencies - run: npm install + run: | + npm install - name: Run Tests run: npm run test:unit From 7ef30bba0f43bac3224c7a9d68774de6492af0ce Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:21:29 +0200 Subject: [PATCH 06/27] fix install deps --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b04c4fd..a5eab7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Install Dependencies run: | - npm install + npm install ci - name: Run Tests run: npm run test:unit From bd0ade4e764cd4adea08b7f796e65ee5bfe45c55 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:34:17 +0200 Subject: [PATCH 07/27] fix install deps --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5eab7f..abd87b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: | - npm install ci + run: npm ci - name: Run Tests run: npm run test:unit From 65bc998369c31821ba1ff316e3d3aaf7e5d433be Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:35:33 +0200 Subject: [PATCH 08/27] fix install deps --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abd87b7..760618b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: npm ci + run: npm ci - name: Run Tests - run: npm run test:unit + run: npm run test:unit From 4f99bd155c67ba8627f0ef5616286e704fd85591 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:43:40 +0200 Subject: [PATCH 09/27] return ignore scripts back --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 760618b..ea9202f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: npm ci + run: npm install --ignore-scripts - name: Run Tests run: npm run test:unit From 2104893d76db26f82be284fa8d762c81a7c09cb9 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:55:08 +0200 Subject: [PATCH 10/27] add prisma generate --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea9202f..139c5ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,8 @@ jobs: - name: Install Dependencies run: npm install --ignore-scripts + - name: Prisma generate + run: npx prisma generate + - name: Run Tests run: npm run test:unit From a4e591822283bda3014121e4758983a2a78c2975 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Tue, 2 Aug 2022 09:41:11 +0200 Subject: [PATCH 11/27] github actions: add postgres and redis --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 139c5ae..9e2f298 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Start containers + run: npm run redis:up && npm run db:up + - name: Use Node.js uses: actions/setup-node@v3 with: From da77693bac34c13b09bc1e7d1fbcd4b7ea144d2a Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 22:56:40 +0200 Subject: [PATCH 12/27] actions: add github actions workflows --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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..6621e63 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + paths-ignore: + - '*.md' + + pull_request: + paths-ignore: + - '*.md' + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install Dependencies + run: | + npm install --ignore-scripts + - name: Run Tests + run: | + npm run test:unit From 8fcf957211b196c88dcca9069f3b44ee97672900 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:11:33 +0200 Subject: [PATCH 13/27] fix run command --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6621e63..49441b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,18 +11,18 @@ on: jobs: test: + runs-on: ubuntu-latest - steps: + + steps: - uses: actions/checkout@v3 - name: Use Node.js uses: actions/setup-node@v3 with: node-version: 16 - + - name: Install Dependencies - run: | - npm install --ignore-scripts + run: npm install --ignore-scripts - name: Run Tests - run: | - npm run test:unit + run: npm run test:unit From 5598ae27675facc7f4cd8f0c91a35a16917311ce Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:12:54 +0200 Subject: [PATCH 14/27] remove ignore scripts --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49441b9..5f62d77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,6 @@ jobs: node-version: 16 - name: Install Dependencies - run: npm install --ignore-scripts + run: npm install - name: Run Tests run: npm run test:unit From 8970ab8090db0bfd6581261d6708ea0ad91e83b1 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:18:31 +0200 Subject: [PATCH 15/27] fix install deps --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f62d77..5c4c9b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,5 +24,6 @@ jobs: - name: Install Dependencies run: npm install + - name: Run Tests run: npm run test:unit From ea0d74688f78048b646a1203586f416b0e16f014 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:20:44 +0200 Subject: [PATCH 16/27] fix install deps --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c4c9b2..b04c4fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,8 @@ jobs: node-version: 16 - name: Install Dependencies - run: npm install + run: | + npm install - name: Run Tests run: npm run test:unit From 2dc6c3c1285ce87a1e5fd9f75de6a9c7b9e1a85b Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:21:29 +0200 Subject: [PATCH 17/27] fix install deps --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b04c4fd..a5eab7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Install Dependencies run: | - npm install + npm install ci - name: Run Tests run: npm run test:unit From f438a1f8973d06fc074bff0df0f9cf0f3455ff96 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:34:17 +0200 Subject: [PATCH 18/27] fix install deps --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5eab7f..abd87b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: | - npm install ci + run: npm ci - name: Run Tests run: npm run test:unit From 9868b88b690c3441dfbaff9a22ce072b797ed247 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:35:33 +0200 Subject: [PATCH 19/27] fix install deps --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abd87b7..760618b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: npm ci + run: npm ci - name: Run Tests - run: npm run test:unit + run: npm run test:unit From f1a9f88ec510f4ddbf0b1c33b92702598b8cccbd Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:43:40 +0200 Subject: [PATCH 20/27] return ignore scripts back --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 760618b..ea9202f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: node-version: 16 - name: Install Dependencies - run: npm ci + run: npm install --ignore-scripts - name: Run Tests run: npm run test:unit From f2783a2e50aef47333528f43928058380cdb9732 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Mon, 1 Aug 2022 23:55:08 +0200 Subject: [PATCH 21/27] add prisma generate --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea9202f..139c5ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,5 +25,8 @@ jobs: - name: Install Dependencies run: npm install --ignore-scripts + - name: Prisma generate + run: npx prisma generate + - name: Run Tests run: npm run test:unit From ac7e3cc3a78f77a0dbd329898d75aa74c4004eaa Mon Sep 17 00:00:00 2001 From: MomenNano Date: Tue, 2 Aug 2022 09:41:11 +0200 Subject: [PATCH 22/27] github actions: add postgres and redis --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 139c5ae..9e2f298 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Start containers + run: npm run redis:up && npm run db:up + - name: Use Node.js uses: actions/setup-node@v3 with: From f0b489cb8e7fb024e0e46a000e8c874a733d027a Mon Sep 17 00:00:00 2001 From: MomenNano Date: Tue, 2 Aug 2022 10:26:54 +0200 Subject: [PATCH 23/27] github actions: create .env file --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e2f298..16f3cdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: create .env file + run: npm run create:env + - name: Start containers run: npm run redis:up && npm run db:up From 550c49226bf01357d80b7dc6d1b7ee6b0c4a27e0 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Tue, 2 Aug 2022 14:30:40 +0200 Subject: [PATCH 24/27] github actions: read env from github secrets --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16f3cdb..00de688 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,9 @@ on: paths-ignore: - '*.md' +env: + DATABASE_URL= ${{ secrets.DATABASE_URL }} + jobs: test: From 89c84d820c099a834dcf88708cf4903e519a7810 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Tue, 2 Aug 2022 14:33:16 +0200 Subject: [PATCH 25/27] github actions: read env from github secrets --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00de688..eeaf9cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: - '*.md' env: - DATABASE_URL= ${{ secrets.DATABASE_URL }} + DATABASE_URL: ${{ secrets.DATABASE_URL }} jobs: test: From 8b87315fd30c81afa9350a6344db2e16fcae3d56 Mon Sep 17 00:00:00 2001 From: MomenNano Date: Tue, 2 Aug 2022 15:16:14 +0200 Subject: [PATCH 26/27] github actions: read env from github secrets --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eeaf9cc..2a4b86f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,4 +38,6 @@ jobs: run: npx prisma generate - name: Run Tests + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} run: npm run test:unit From f121184c2529ecd8bc45868340fe6b3216a714af Mon Sep 17 00:00:00 2001 From: MomenNano Date: Tue, 2 Aug 2022 17:52:02 +0200 Subject: [PATCH 27/27] github actions: add postgres credentials --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a4b86f..cf45281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,10 @@ jobs: run: npm run create:env - name: Start containers + env: + POSTGRES_USER: ${{ secrets.POSTGRES_USER }} + POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} + POSTGRES_DB: ${{ secrets.POSTGRES_DB }} run: npm run redis:up && npm run db:up - name: Use Node.js