Merge pull request #9 from Felix221123/dependabot/npm_and_yarn/fronte… #66
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: | |
workflow_dispatch: # Enables manual triggering from GitHub UI or CLI | |
jobs: | |
build: | |
name: Run Code formatting , type checking & tests, Project Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Install dependencies | |
run: npm ci | |
working-directory: ./frontend | |
- name: Format code | |
run: npm run format:style | |
working-directory: ./frontend | |
- name: Run unit tests | |
run: npm run test | |
working-directory: ./frontend | |
- name: Build the project | |
run: npm run build --if-present | |
working-directory: ./frontend | |
- name: Install dependencies for backend | |
run: npm install | |
working-directory: ./backend | |
- name: Format code | |
run: npm run format:style | |
working-directory: ./backend | |
- name: Set up environment variables | |
run: | | |
echo "MONGO_CONNECTION_STRING=mockConnectionString" >> $GITHUB_ENV | |
echo "PORT=3000" >> $GITHUB_ENV | |
echo "SERVER_TOKEN_EXPIRETIME=3600" >> $GITHUB_ENV | |
echo "SERVER_TOKEN_ISSUER=mockIssuer" >> $GITHUB_ENV | |
echo "SERVER_TOKEN_SECRET=mockSecret" >> $GITHUB_ENV | |
echo "SERVER_HOSTNAME=mockHostname" >> $GITHUB_ENV | |
echo "RESEND_EMAIL_API_KEY=resendemailapikey" >> $GITHUB_ENV | |
echo "NODE_ENV=nodeenvironment" >> $GITHUB_ENV | |
echo "FRONTEND_BASE_URL=baseurl" >> $GITHUB_ENV | |
- name: Run backend unit tests using jest framework | |
run: npm run test | |
working-directory: ./backend | |
- name: Build the project | |
run: npm run build | |
working-directory: ./backend |