Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
from buildbot.plugins import steps
from buildbot.plugins import util
from config_module import tokens
import os
env = {
"CCACHE_DIR": util.Interpolate(
os.path.join("/cache", "%(prop:distro)s", "ccache")
),
"PATH": ["/usr/lib/ccache/", "/usr/lib64/ccache/", "${PATH}"]
}
def build_coverage():
remove_build = steps.RemoveDirectory("build")
create_build = steps.MakeDirectory("build")
cmake_step = steps.CMake(
path=util.Property("src_dir"),
definitions=util.Property("cmake_defs", {}),
options=util.Property("cmake_opts", []),
workdir="build",
env=env
)
def __init__(self, branch):
super().__init__(
doStepIf=self._has_the_build_failed,
workersrc="test-results.xml",
masterdest=util.Interpolate(
f"/data/www/buildbot/test-results/{branch}/%(prop:buildername)s/build_%(prop:buildnumber)s.xml"
),
mode=0o755,
)
def interpolate_constructor(loader, node):
value = loader.construct_scalar(node)
return util.Interpolate(value)