Feature/notification crud logic #24
Workflow file for this run
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: Node.js CI | |
on: | |
push: | |
branches: | |
- master # Run the CI on pushes to the main branch | |
pull_request: | |
branches: | |
- master # Run CI on pull requests targeting main | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Node.js | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 # Replace with your project's Node.js version | |
cache: 'npm' # Cache npm dependencies | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Step 4: Run tests | |
- name: Run tests | |
run: npm test | |
# Step 5: Build the project | |
- name: Build the project | |
run: npm run build --if-present | |
# Step 6: Check for vulnerabilities (optional) | |
- name: Audit dependencies | |
run: npm audit --production | |
continue-on-error: true # Allow the workflow to continue even if vulnerabilities are found |