From 697b284f66b4ade95c7c012549cad48f37302767 Mon Sep 17 00:00:00 2001 From: Genadii Ganebnyi Date: Tue, 21 Feb 2023 16:34:30 +0200 Subject: [PATCH 1/5] Create nestjs-mongoose-ci.yml --- .github/workflows/nestjs-mongoose-ci.yml | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/nestjs-mongoose-ci.yml diff --git a/.github/workflows/nestjs-mongoose-ci.yml b/.github/workflows/nestjs-mongoose-ci.yml new file mode 100644 index 0000000..b3cc9df --- /dev/null +++ b/.github/workflows/nestjs-mongoose-ci.yml @@ -0,0 +1,53 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Cache node_modules + id: deps_cache + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-build-${{ hashFiles( '**/yarn.lock' ) }} + - name: Setup yarn + run: npm install -g yarn + - name: Install dependencies + if: steps.deps_cache.outputs.cache-hit != 'true' + run: yarn install --frozen-lockfile + - name: Run build API + run: yarn run build:api + - name: Run build CRON + run: yarn run build:cron + scan: + runs-on: ubuntu-latest + needs: + - build + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Cache node_modules + uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-build-${{ hashFiles( '**/yarn.lock' ) }} + - name: Setup yarn + run: npm install -g yarn + - name: Install dependencies + run: yarn install --frozen-lockfile + - name: Qodana Scan + uses: JetBrains/qodana-action@v4.2.5 + with: + linter: jetbrains/qodana-js + changes: true From deb4866dd0a00ed708dffc87bb469a8659ac92e7 Mon Sep 17 00:00:00 2001 From: Genadii Ganebnyi Date: Tue, 21 Feb 2023 16:38:37 +0200 Subject: [PATCH 2/5] Update nestjs-mongoose-ci.yml --- .github/workflows/nestjs-mongoose-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/nestjs-mongoose-ci.yml b/.github/workflows/nestjs-mongoose-ci.yml index b3cc9df..2b52f2e 100644 --- a/.github/workflows/nestjs-mongoose-ci.yml +++ b/.github/workflows/nestjs-mongoose-ci.yml @@ -9,6 +9,10 @@ on: pull_request: branches: [ "master" ] +defaults: + run: + working-directory: ./nestjs-mongoose + jobs: build: runs-on: ubuntu-latest From e20c3f52a789f50849c3f5e592a85f3aee31b175 Mon Sep 17 00:00:00 2001 From: Genadii Ganebnyi Date: Tue, 21 Feb 2023 16:52:14 +0200 Subject: [PATCH 3/5] Update nestjs-mongoose-ci.yml --- .github/workflows/nestjs-mongoose-ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nestjs-mongoose-ci.yml b/.github/workflows/nestjs-mongoose-ci.yml index 2b52f2e..ed13987 100644 --- a/.github/workflows/nestjs-mongoose-ci.yml +++ b/.github/workflows/nestjs-mongoose-ci.yml @@ -14,7 +14,7 @@ defaults: working-directory: ./nestjs-mongoose jobs: - build: + build-and-test: runs-on: ubuntu-latest steps: - name: Checkout @@ -30,14 +30,14 @@ jobs: - name: Install dependencies if: steps.deps_cache.outputs.cache-hit != 'true' run: yarn install --frozen-lockfile - - name: Run build API - run: yarn run build:api - - name: Run build CRON - run: yarn run build:cron + - name: Run build + run: yarn build + - name: Run tests with coverage + run: yarn test:cov scan: runs-on: ubuntu-latest needs: - - build + - build-and-test steps: - name: Checkout uses: actions/checkout@v2 From 9766e323a21b05404bfb105ec49269b523788a15 Mon Sep 17 00:00:00 2001 From: Genadii Ganebnyi Date: Tue, 21 Feb 2023 17:07:43 +0200 Subject: [PATCH 4/5] Update nestjs-mongoose-ci.yml --- .github/workflows/nestjs-mongoose-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nestjs-mongoose-ci.yml b/.github/workflows/nestjs-mongoose-ci.yml index ed13987..9acb6b3 100644 --- a/.github/workflows/nestjs-mongoose-ci.yml +++ b/.github/workflows/nestjs-mongoose-ci.yml @@ -1,7 +1,7 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs -name: CI +name: nestjs-mongoose CI on: push: From 6cb9eed0fd3b5d39c7ccc9413029e5829170cb31 Mon Sep 17 00:00:00 2001 From: Genadii Ganebnyi Date: Tue, 21 Feb 2023 17:23:31 +0200 Subject: [PATCH 5/5] Update nestjs-mongoose-ci.yml --- .github/workflows/nestjs-mongoose-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/nestjs-mongoose-ci.yml b/.github/workflows/nestjs-mongoose-ci.yml index 9acb6b3..1376cbb 100644 --- a/.github/workflows/nestjs-mongoose-ci.yml +++ b/.github/workflows/nestjs-mongoose-ci.yml @@ -32,8 +32,6 @@ jobs: run: yarn install --frozen-lockfile - name: Run build run: yarn build - - name: Run tests with coverage - run: yarn test:cov scan: runs-on: ubuntu-latest needs: