Merge pull request #174 from gitfrosh/dependabot/npm_and_yarn/sample-… #238
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and Build Merge Requests | |
on: | |
push: | |
paths-ignore: | |
- 'db/**' | |
pull_request: | |
paths-ignore: | |
- 'db/**' | |
jobs: | |
test-and-build: | |
runs-on: ubuntu-latest | |
# Define Node versions to run CI/CD on | |
strategy: | |
matrix: | |
node-version: [21.x] | |
steps: | |
# Checkout project | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Setup Node | |
- name: Use Node.js ${{ matrix.node-version }} for frontend | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
# BACKEND # | |
# Install Packages | |
- name: Install Dependencies for Backend | |
working-directory: ./backend | |
run: npm ci | |
# Run Jest tests | |
- name: Run Tests | |
working-directory: ./backend | |
run: npm run test | |
# FRONTEND # | |
# Install Packages | |
- name: Install Dependencies for Frontend | |
working-directory: ./frontend | |
run: npm ci | |
# Run Jest tests | |
- name: Run Tests | |
working-directory: ./frontend | |
run: npm run test | |
# SAMPLE-APP # | |
# Install Packages | |
- name: Install Dependencies for Sample App | |
working-directory: ./sample-app | |
run: npm ci | |
# Run Jest tests | |
- name: Run Build | |
working-directory: ./sample-app | |
run: npm run build |