TASK-11 Implement Journals Table and API #28
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: Run Backend Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
backend-test: | |
name: Backend Test | |
runs-on: ubuntu-latest | |
environment: main | |
env: | |
DB_HOST: ${{ secrets.DB_HOST }} | |
DB_NAME: ${{ secrets.DB_NAME }} | |
DB_USER: ${{ secrets.DB_USER }} | |
DB_USER_PASS: ${{ secrets.DB_USER_PASS }} | |
DB_PASS: ${{ secrets.DB_PASS }} | |
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | |
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
PORT: ${{ secrets.PORT }} | |
JWT_SECRET: ${{ secrets.JWT_SECRET }} | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Node.js (no need to set working-directory here) | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 # Specify your Node.js version | |
# Step 3: Install dependencies (in the backend folder) | |
- name: Install dependencies | |
working-directory: ./backend # Change to backend folder | |
run: npm install | |
# Step 4: Run tests (in the backend folder) | |
- name: Run Jest tests | |
working-directory: ./backend # Change to backend folder | |
run: npm test | |
env: | |
CI: true # Ensures proper output in CI environments |