Class CIrunner

java.lang.Object
com.group8.CIrunner

public class CIrunner extends Object
Core CI pipeline runner.

Given a Git repository URL, branch ref and commit SHA, this class:

  1. Clones the repository into a dedicated build directory.
  2. Runs mvn compile on the cloned project (P1).
  3. Runs mvn test on the cloned project (P2).
  4. Reports the overall result as a BuildRecord and updates the GitHub commit status (P3).
  • Constructor Details

    • CIrunner

      public CIrunner()
  • Method Details

    • runner

      public static int runner(List<String> cmd, File dir) throws IOException, InterruptedException
      Executes the given command in the specified working directory.
      Parameters:
      cmd - list representing the command and its arguments
      dir - working directory in which the process should run
      Returns:
      the process exit code; 0 means success
      Throws:
      IOException - if the process cannot be started
      InterruptedException - if the current thread is interrupted while waiting
    • triggerCI

      public static BuildRecord triggerCI(String cloneUrl, String ref, String sha)
      Triggers the CI workflow for a single commit.
      Parameters:
      cloneUrl - HTTPS clone URL of the target repository
      ref - Git ref that triggered the build (e.g. refs/heads/main)
      sha - commit SHA to build and test
      Returns:
      a BuildRecord capturing status, timestamp and build log