Skip to content

Commit

Permalink
update workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
janapc committed Feb 19, 2024
1 parent 33979ae commit 48e478e
Showing 1 changed file with 15 additions and 37 deletions.
52 changes: 15 additions & 37 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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

0 comments on commit 48e478e

Please sign in to comment.