pipeline {
    agent any // Or use 'dockerfile' if running in a container
    stages {
        stage('Clean') {
            steps {
                sh 'rm -rf build'
                echo "Cleaning branch ${env.BRANCH_NAME}"
            }
        }
        stage('Configure') {
            steps {
                // Configure CMake to generate build files in the 'build' directory
                echo "Configure project"
                sh 'mkdir build'
            }
        }
        stage('Build') {

            steps {
                // Build the project using the generated files
                echo "Build project"

                 sh './localbuild.sh'
            }
        }
        stage('Test') {
            steps {
                // Run the executable to verify it works
                echo "Test project"
                sh 'tests/tests'
            }
        }
    }
}
