Skip to content

Merge pull request #225 from ElzabeEls/17-sorting-recipes-by-date #188

Merge pull request #225 from ElzabeEls/17-sorting-recipes-by-date

Merge pull request #225 from ElzabeEls/17-sorting-recipes-by-date #188

Workflow file for this run

name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
env: # Set environment variables at the job level
MONGODB_URI: ${{ secrets.MONGODB_URI }} # Ensure this is correctly set
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Debug MongoDB URI
run: echo "MONGODB_URI is set to: $MONGODB_URI" # Use the env variable instead of the secret directly

Check failure on line 28 in .github/workflows/linting.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/linting.yml

Invalid workflow file

You have an error in your yaml syntax on line 28
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
- name: Cache node modules
uses: actions/[email protected]
with:
path: node_modules
key: node-modules-${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
node-modules-${{ runner.os }}-node-${{ matrix.node-version }}
- run: npm ci --legacy-peer-deps
- run: npm run lint
- run: npm run build --if-present
- name: Run tests
run: |
cd backend
npx mocha --config .mocharc.json