Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added github actions for backend testing #21

Merged
merged 6 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 31 additions & 7 deletions .github/workflows/linux_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js CI
name: Backend and Frontend CI testing

on:
push:
Expand All @@ -7,17 +7,20 @@ on:
branches: [ "main" ]

jobs:
Run-Test:

build-frontend:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to test-frontend or build-backend?

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]
defaults:
run:
working-directory: ./webapp

steps:
- name: Chekout the repository
uses: actions/checkout@v4
with:
sparse-checkout: ./webapp
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand All @@ -26,10 +29,31 @@ jobs:
cache-dependency-path: ./webapp/package-lock.json
- name: Install packages
run: npm ci
working-directory: ./webapp
- name: Build project
run: npm run build
working-directory: ./webapp
- name: Run tests
run: npm test
working-directory: ./webapp

build-backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
env:
DJANGO_API_KEY: EMPTY_KEY
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: ./backend
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Import requirements
run: pip install -r requirements.txt
- name: Check migrations
run: python manage.py migrate
- name: Run django tests
run: python manage.py test
1 change: 1 addition & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ asgiref==3.8.1
Django==5.1.5
django-cors-headers==4.6.0
djangorestframework==3.15.2
djangorestframework_simplejwt==5.4.0
PyJWT==2.10.1
pytz==2025.1
sqlparse==0.5.3
Expand Down