Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into C3SC-59
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewyDo committed Nov 29, 2024
2 parents 8e1c4d9 + 146c440 commit 2d45d06
Show file tree
Hide file tree
Showing 8 changed files with 343 additions and 55 deletions.
77 changes: 23 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Java Swing CI with MySQL
name: Java CI with LOC Counting

# Trigger the workflow on pushes to main and pull requests to main
on:
push:
branches:
Expand All @@ -10,64 +9,34 @@ on:
- main

jobs:
ci:
build:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: test_db
MYSQL_USER: user
MYSQL_PASSWORD: user_password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=30s
--health-timeout=5s
--health-retries=3
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3

# Step 2: Set up Java Development Kit (JDK)
- name: Set up JDK 11
uses: actions/setup-java@v3
# Checkout the code
- name: Checkout code
uses: actions/checkout@v2
# Cache Maven dependencies
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
java-version: '11'
distribution: 'adoptopenjdk'

# Step 3: Install MySQL client (if needed for testing connection)
- name: Install MySQL client
run: sudo apt-get install mysql-client
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/*.java') }}
restore-keys: |
${{ runner.os }}-maven-
# Step 4: Build the Java application with Maven or Gradle
# Build with Maven (check for compilation errors)
- name: Build with Maven
run: mvn clean install

# Run Checkstyle (static code analysis)
- name: Run Checkstyle
run: mvn checkstyle:check

# Step 5: Run tests (unit tests and integration tests)
- name: Run tests
run: mvn test

# Step 6: (Optional) Package your app into a JAR file
- name: Package application
run: mvn package

# Step 7: Run integration tests with MySQL
- name: Run integration tests with MySQL
# Count Lines of Code using cloc
- name: Count Lines of Code
run: |
echo "Waiting for MySQL to be ready..."
sleep 30 # Wait for MySQL to be ready (or use a better method for health check)
mvn verify -P integration-tests
# Secrets can be used for sensitive data like MySQL password and username.
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 3306
MYSQL_USER: user
MYSQL_PASSWORD: user_password
MYSQL_DB: test_db
sudo apt-get update
sudo apt-get install -y cloc
cloc --exclude-dir=target --quiet . # Exclude 'target' directory to avoid counting compiled files
32 changes: 32 additions & 0 deletions People.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import java.time.LocalDate;

public class Person {
public String first_name;
public String last_name;
public String email_address;
public LocalDate date_of_birth;
public long phone_number;

public Person(){}
public Person(String firstName, String lastName, String emailAddress, LocalDate birthDate, long phoneNumber) {
first_name = firstName.toLowerCase();
last_name = lastName.toLowerCase();
email_address = emailAddress.toLowerCase();
date_of_birth = birthDate;
phone_number = phoneNumber;
}

public String getFirstName(){return first_name;}
public String getLastName(){return last_name;}
public String getName(){return first_name.toUpperCase().charAt(0)+first_name.substring(1) + " " + last_name.toUpperCase().charAt(0)+last_name.substring(1);}
public String getEmailAddress(){return email_address;}
public LocalDate getBirthDate(){return date_of_birth;}
public long getPhoneNumber(){return phone_number;}

public String toString(){
return getName() + " -> {\n\t"
+ date_of_birth.toString() + "\n\t"
+ "Email: " + email_address + "\n\t"
+ "Phone Number" + phone_number + "\n}";
}
}
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
# softeng-health-club-app
# SoftEng Health Club Membership Management System

## Table of Contents
- [About the App](#about-the-app)
- [Technologies Used](#technologies-used)
- [Implementation Details](#implementation-details)
- [Testing Details](#testing-details)
- [Known Bugs](#known-bugs)
- [About the Team](#about-the-team)
- [Contact Information](#contact-information)

## About the App
The SoftEng Health Club is known for its commitment to member satisfaction. It aims to enhance its services with a new membership management system. As the club grows, it seeks to streamline operations and improve communication with its members. This system will help SoftEng efficiently manage memberships, handle renewals, and support better member engagement. With a focus on maintaining its reputation for excellent service. This new system will ensure both staff and members enjoy a smooth experience. The system will be designed to handle various membership durations, notify members of upcoming renewals, and allow for on-the-spot membership renewals and sign-up. Additionally, it will offer tools for the club’s management to monitor member activity and generate reports for operational decisions. The following document outlines the complete design needed to meet these objectives and ensure smooth operation for both members and staff. The SoftEng Health Club's suggested membership management system is made to specifically address the demands of both the club and its customers. This solution will increase membership satisfaction by emphasizing automation, user experience, and data insights through specialized latent tasks.

## Technologies Used
- **Java**: Primary programming language for backend development.
- **MySQL**: Database management system for storing and retrieving all membership data.

## Implementation Details
[To be completed]

## Testing Details
[To be completed]

## Known Bugs
[To be noted]

## About the Team
This project is developed by a dedicated team of software engineering students from the COMP330 course. The team has embraced the challenge of developing a robust membership management system and has shown exceptional commitment to continuous improvement and clear communication.

## Contact Information
For more details about the project, or to reach out with questions or suggestions, please contact the following team members:
- **Nahum Gessesse** - Developer
- **Xander Estevez** - Developer
- **Manali Deb** - QA/Technical Writer
- **Alina Zacaria** - Tech Lead
- **Andrew Do** - Developer
- **Nick Calhoun** - Developer
- **Jai Fischer** - Developer
64 changes: 64 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>loc-counting</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Java LOC Counting</name>
<description>Project to count Lines of Code and run static analysis</description>
<url>http://example.com</url>

<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.45</version>
<scope>plugin</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
</build>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
2 changes: 2 additions & 0 deletions target/checkstyle-cachefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Fri Nov 29 14:27:34 CST 2024
configuration*?=2A3257BC3DFCB9863B7B6609A03404712ED001EA
Loading

0 comments on commit 2d45d06

Please sign in to comment.