#!groovy

// Copyright (c) 2020 ETH Zurich
// Copyright (c) 2022 Hartmut Kaiser
// Copyright (c) 2023 Panos Syskakis
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

pipeline {
    agent any
    options {
        buildDiscarder(
            logRotator(
                daysToKeepStr: "14",
                numToKeepStr: "50",
                artifactDaysToKeepStr: "14",
                artifactNumToKeepStr: "50"
            )
        )
    }

    stages {
        stage('test-coverage') {
            environment{
                CODACY_TOKEN = credentials('CODACY_TOKEN_HPX')
                configuration_name = "test-coverage"
            }
            steps {
                echo "Running ${env.BUILD_ID} on ${env.JENKINS_URL}"
                sh '''
                #!/bin/bash -l
                .jenkins/lsu-test-coverage/entry.sh
                '''
            }
        }
    }

    post {
        always {
            archiveArtifacts artifacts: 'jenkins-hpx-*', fingerprint: true
            archiveArtifacts artifacts: 'grcov-log.txt', fingerprint: true
        }
    }
}
