From 48e478e8eeae3615e04dd7eae2366b6828a3fd47 Mon Sep 17 00:00:00 2001 From: janapc Date: Mon, 19 Feb 2024 12:31:05 -0300 Subject: [PATCH] update workflow file --- .github/workflows/node.js.yml | 52 ++++++++++------------------------- 1 file changed, 15 insertions(+), 37 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 2f420a5..b2a507a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,6 +1,3 @@ -# 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: Node.js CI on: @@ -9,45 +6,26 @@ on: pull_request: branches: ["main"] +env: + NODE_VERSION: 20 + jobs: linter: runs-on: ubuntu-latest - name: Code analysis - strategy: - matrix: - node-version: [20.x] - steps: - - uses: actions/checkout@v3 - - name: Verify code - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - working-directory: ./catalog - - run: npm run linter - working-directory: ./catalog - - run: npm ci - working-directory: ./lambda - - run: npm run linter - working-directory: ./lambda - - tests: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x] + name: Static Code Analysis steps: - uses: actions/checkout@v3 - - name: Tests unit + - name: Run linting rules uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: ${{env.NODE_VERSION}} cache: "npm" - - run: npm ci - working-directory: ./catalog - - run: npm run test - working-directory: ./catalog - - run: npm ci - working-directory: ./lambda - - run: npm run test - working-directory: ./lambda + cache-dependency-path: | + catalog/package-lock.json + lambda/package-lock.json + - name: analyze in the catalog folder + working-directory: catalog + run: npm ci && npm run linter + - name: analyze in the lambda folder + working-directory: lambda + run: npm ci && npm run linter