Skip to content

feat: implement npm workspaces #161

feat: implement npm workspaces

feat: implement npm workspaces #161

name: Validate and Build API
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate-n-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check for changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
api:
- 'apps/api/**'
- 'packages/shared/**'
- name: Setup Node.js
if: steps.filter.outputs.api == 'true'
uses: actions/setup-node@v4
with:
node-version: 20.8.1
cache: npm
cache-dependency-path: ts/package-lock.json
- name: Run static code analysis
if: steps.filter.outputs.api == 'true'
run: |
cd api
npm run lint
- name: Run unit tests
if: steps.filter.outputs.api == 'true'
run: |
cd api
npm run test:unit
- name: Build the Docker image for API
if: steps.filter.outputs.api == 'true'
run: docker build -f Dockerfile.api -t cloudmos-api .