Skip to content

express-router

express-router #305

Workflow file for this run

# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: ["**"]
pull_request:
branches: [master]
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
MOVIE_API: ${{ secrets.MOVIE_API }}
TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }}
REACT_APP_BACKEND_URL: ${{ secrets.BACKEND_URL }}
jobs:
backend:
runs-on: ${{ matrix.os }} #ubuntu-latest
defaults:
run:
working-directory: ./backend
strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
node-version: [16.x]
#See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: ./backend/package-lock.json
- run: npm ci # similar to npm install
- run: npm run build --if-present
frontend:
runs-on: ${{ matrix.os }} #ubuntu-latest
defaults:
run:
working-directory: ./react-frontend
strategy:
matrix:
os: [ubuntu-latest] # macos-latest, windows-latest
node-version: [18.x]
#See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: ./react-frontend/yarn.lock
- run: yarn install # similar to npm install
- run: yarn test
working-directory: ./react-frontend
- run: yarn run build-internal --if-present