Class CIrunner
java.lang.Object
com.group8.CIrunner
Core CI pipeline runner.
Given a Git repository URL, branch ref and commit SHA, this class:
- Clones the repository into a dedicated build directory.
- Runs
mvn compileon the cloned project (P1). - Runs
mvn teston the cloned project (P2). - Reports the overall result as a
BuildRecordand updates the GitHub commit status (P3).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
CIrunner
public CIrunner()
-
-
Method Details
-
runner
Executes the given command in the specified working directory.- Parameters:
cmd- list representing the command and its argumentsdir- working directory in which the process should run- Returns:
- the process exit code;
0means success - Throws:
IOException- if the process cannot be startedInterruptedException- if the current thread is interrupted while waiting
-
triggerCI
Triggers the CI workflow for a single commit.- Parameters:
cloneUrl- HTTPS clone URL of the target repositoryref- Git ref that triggered the build (e.g.refs/heads/main)sha- commit SHA to build and test- Returns:
- a
BuildRecordcapturing status, timestamp and build log
-