Skip to content

Commit 0f57bd0

Browse files
Merge pull request #77 from UNLV-CS472-672/adding-to-ci-pipeline
Adding to ci pipeline
2 parents 0049d40 + 706bd4f commit 0f57bd0

File tree

13 files changed

+122
-87
lines changed

13 files changed

+122
-87
lines changed

.github/workflows/django_ci_cd.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ jobs:
2828
sudo service redis-server start
2929
sudo service redis-server status
3030
31+
- name: Install Flake8 and Run Linter
32+
run: |
33+
pip install flake8
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
36+
3137
- name: Install Dependencies
3238
run: |
3339
python -m pip install --upgrade pip
@@ -59,3 +65,4 @@ jobs:
5965
with:
6066
name: coverage-report-html
6167
path: backend/htmlcov/ # Upload the entire 'htmlcov' directory
68+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: ReactJS CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
lint:
10+
name: Run ESLint
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- name: Install root dependencies
23+
run: npm install # This will install the dependencies from the root `package.json`
24+
25+
- name: Install frontend dependencies
26+
run: |
27+
cd frontend # Navigate to the frontend directory
28+
npm install # Install the frontend dependencies from `frontend/package.json`
29+
30+
- name: Run ESLint # Finds syntax/style errors
31+
run: npx eslint --config ./frontend/eslint.config.js frontend

backend/apps/uploads/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def patch(self, request, public_id):
8080
# Return updated specific upload details to front-end
8181
return Response({'status': 'success', 'data': serializer.data}, status=status.HTTP_200_OK)
8282
else:
83-
return Response(status=HTTP_400_BAD_REQUEST)
83+
return Response(status=status.HTTP_400_BAD_REQUEST)
8484
# Note: Tested this PATCH request by entering this into the command line
8585
# curl -X PATCH http://127.0.0.1:8000/uploads/{public_id}/ -H "Content-Type: application/json" -d '{"description": "Updated upload description"}'
8686

frontend/eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import reactRefresh from 'eslint-plugin-react-refresh'
77
export default [
88
{ ignores: ['dist'] },
99
{
10-
files: ['**/*.{js,jsx}'],
10+
files: ['**/*.{js,jsx,ts,tsx}'],
1111
languageOptions: {
1212
ecmaVersion: 2020,
1313
globals: globals.browser,
@@ -35,4 +35,4 @@ export default [
3535
],
3636
},
3737
},
38-
]
38+
]

frontend/package-lock.json

Lines changed: 49 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
"@types/react": "^19.0.8",
2222
"@types/react-dom": "^19.0.3",
2323
"@vitejs/plugin-react": "^4.3.4",
24-
"eslint": "^9.19.0",
24+
"eslint": "^9.23.0",
2525
"eslint-plugin-react": "^7.37.4",
26-
"eslint-plugin-react-hooks": "^5.0.0",
27-
"eslint-plugin-react-refresh": "^0.4.18",
26+
"eslint-plugin-react-hooks": "^5.2.0",
27+
"eslint-plugin-react-refresh": "^0.4.19",
2828
"globals": "^15.14.0",
2929
"vite": "^6.1.0"
3030
}

frontend/src/Components/Booking.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from "react";
1+
import { useState } from "react";
22
import Calendar from "react-calendar";
33
import "react-calendar/dist/Calendar.css"; // npm install react-calendar
44
import "../Styles/Booking.css";

frontend/src/Components/Contact.jsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import '../Styles/Contact.css'
22
export default function Contact() {
33
return (
44
<>
5-
<section class="contact-header">
6-
<div class="container">
7-
<h1 class="text-center fw-bold">Contact Us</h1>
8-
<p class="text-center text-muted">
5+
<section className="contact-header">
6+
<div className="container">
7+
<h1 className="text-center fw-bold">Contact Us</h1>
8+
<p className="text-center text-muted">
99
Have questions? We’re here to help.
1010
</p>
1111
</div>
1212
</section>
1313

14-
<section class="contact-info container my-5">
15-
<div class="row">
16-
<div class="col-md-6">
14+
<section className="contact-info container my-5">
15+
<div className="row">
16+
<div className="col-md-6">
1717
<h3>Contact Information</h3>
1818
<p><strong>Email:</strong> support@lessonconnect.com</p>
1919
<p><strong>Phone:</strong> (702) 555-1234</p>
@@ -23,37 +23,37 @@ export default function Contact() {
2323
</p>
2424
<p><strong>Location:</strong> University of Nevada, Las Vegas</p>
2525
</div>
26-
<div class="col-md-6">
26+
<div className="col-md-6">
2727
<h3>Get in Touch</h3>
2828
<form>
29-
<div class="mb-3">
30-
<label for="name" class="form-label">Full Name</label>
29+
<div className="mb-3">
30+
<label htmlFor="name" className="form-label">Full Name</label>
3131
<input
3232
type="text"
33-
class="form-control"
33+
className="form-control"
3434
id="name"
3535
placeholder="Enter your name"
3636
/>
3737
</div>
38-
<div class="mb-3">
39-
<label for="email" class="form-label">Email Address</label>
38+
<div className="mb-3">
39+
<label htmlFor="email" className="form-label">Email Address</label>
4040
<input
4141
type="email"
42-
class="form-control"
42+
className="form-control"
4343
id="email"
4444
placeholder="Enter your email"
4545
/>
4646
</div>
47-
<div class="mb-3">
48-
<label for="message" class="form-label">Message</label>
47+
<div className="mb-3">
48+
<label htmlFor="message" className="form-label">Message</label>
4949
<textarea
50-
class="form-control"
50+
className="form-control"
5151
id="message"
5252
rows="4"
5353
placeholder="Type your message"
5454
></textarea>
5555
</div>
56-
<button type="submit" class="btn btn-primary">Send Message</button>
56+
<button type="submit" className="btn btn-primary">Send Message</button>
5757
</form>
5858
</div>
5959
</div>

frontend/src/Components/FAQS.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default function FAQS() {
44
return (
55
<div className="faq-page">
66
{/* FAQ Section */}
7-
// FAQ Background Section
7+
{/* FAQ Background Section */}
88
<div className="faq-background">
99
<img src="assets/images/FAQs.webp" alt="FAQs Background" className="faq-bg-image" />
1010
<h1 className="faq-title">FAQs:</h1>
@@ -122,15 +122,14 @@ export default function FAQS() {
122122
data-bs-parent="#faqAccordion"
123123
>
124124
<div className="accordion-body">
125-
If you're interested in tutoring, sign up as a tutor and
126-
complete the verification process.
125+
If you&apos;re interested in tutoring, sign up as a tutor and complete the verification process.
127126
</div>
128127
</div>
129128
</div>
130129
</div>
131130
{/* Didn't find your answer button */}
132131
<div className="faq-footer">
133-
<p>Didn't find your answer?</p>
132+
<p>Didn&apos;t find your answer?</p>
134133
<a href="/contact" className="faq-button">Click here</a>
135134
</div>
136135
</div>

0 commit comments

Comments
 (0)