From 8367a51c6d8b63ae3195ec5d46d3a2aee6ea7222 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 22 Aug 2019 08:21:24 +0200 Subject: [PATCH] Share most common part of module_config.yaml Change-Id: Ieea5b662e039cff24e26a127b4a3a8610ed588cc Reviewed-by: Alexandru Croitor --- coin/instructions/call_cmake.yaml | 22 ++++ ...cmake_build_and_upload_test_artifacts.yaml | 34 +++++ .../cmake_module_build_instructions.yaml | 46 +++++++ .../cmake_qtbase_build_instructions.yaml | 49 +++++++ .../cmake_regular_test_instructions.yaml | 22 ++++ coin/module_config.yaml | 123 +----------------- 6 files changed, 176 insertions(+), 120 deletions(-) create mode 100644 coin/instructions/call_cmake.yaml create mode 100644 coin/instructions/cmake_build_and_upload_test_artifacts.yaml create mode 100644 coin/instructions/cmake_module_build_instructions.yaml create mode 100644 coin/instructions/cmake_qtbase_build_instructions.yaml create mode 100644 coin/instructions/cmake_regular_test_instructions.yaml diff --git a/coin/instructions/call_cmake.yaml b/coin/instructions/call_cmake.yaml new file mode 100644 index 0000000000..cbb15a7102 --- /dev/null +++ b/coin/instructions/call_cmake.yaml @@ -0,0 +1,22 @@ +type: Group +instructions: + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} {{.InstallDir}}\\bin\\qt-cmake {{.Env.COIN_CMAKE_ARGS}}" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: ExecuteCommand + command: "{{.InstallDir}}/bin/qt-cmake {{.Env.COIN_CMAKE_ARGS}}" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + disable_if: + condition: property + property: host.os + equals_value: Windows diff --git a/coin/instructions/cmake_build_and_upload_test_artifacts.yaml b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml new file mode 100644 index 0000000000..b4a8e80b75 --- /dev/null +++ b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml @@ -0,0 +1,34 @@ +type: Group +instructions: + - type: ChangeDirectory + directory: "{{.SourceDir}}/tests" + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "{{.SourceDir}}\\tests" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "{{.SourceDir}}/tests" + disable_if: + condition: property + property: host.os + equals_value: Windows + - !include "{{qt/qtbase}}/call_cmake.yaml" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: UploadTestArtifact + transferType: UploadModuleTestsArtifact + archiveDirectory: "{{.SourceDir}}/tests" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 +disable_if: + condition: property + property: configureArgs + contains_value: "-DBUILD_SHARED_LIBS=OFF" diff --git a/coin/instructions/cmake_module_build_instructions.yaml b/coin/instructions/cmake_module_build_instructions.yaml new file mode 100644 index 0000000000..04dea98001 --- /dev/null +++ b/coin/instructions/cmake_module_build_instructions.yaml @@ -0,0 +1,46 @@ +type: Group +instructions: + - type: MakeDirectory + directory: .git + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "-DBUILD_TESTING=OFF {{.SourceDir}}" + - !include "{{qt/qtbase}}/call_cmake.yaml" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to install package. + - type: EnvironmentVariable + variableName: DESTDIR + variableValue: "{{.InstallRoot}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to install package for archiving. + - type: SignPackage + enable_if: + condition: property + property: host.os + equals_value: Windows + directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + - type: UploadArtifact + archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + transferType: UploadModuleBuildArtifact + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 diff --git a/coin/instructions/cmake_qtbase_build_instructions.yaml b/coin/instructions/cmake_qtbase_build_instructions.yaml new file mode 100644 index 0000000000..9ceccd9597 --- /dev/null +++ b/coin/instructions/cmake_qtbase_build_instructions.yaml @@ -0,0 +1,49 @@ +type: Group +instructions: + - type: MakeDirectory + directory: .git + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF {{.SourceDir}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to install package. + - type: EnvironmentVariable + variableName: DESTDIR + variableValue: "{{.InstallRoot}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to install package for archiving. + - type: SignPackage + enable_if: + condition: property + property: host.os + equals_value: Windows + directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + - type: UploadArtifact + archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + transferType: UploadModuleBuildArtifact + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 diff --git a/coin/instructions/cmake_regular_test_instructions.yaml b/coin/instructions/cmake_regular_test_instructions.yaml new file mode 100644 index 0000000000..10a8d6fbff --- /dev/null +++ b/coin/instructions/cmake_regular_test_instructions.yaml @@ -0,0 +1,22 @@ +type: Group +instructions: + - type: InstallTestBinaryArchive + relativeStoragePath: "{{.Env.MODULE_ARTIFACTS_RELATIVE_STORAGE_PATH}}/tests.tar.gz" + directory: "{{.SourceDir}}/tests" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install tests archive. + - type: ChangeDirectory + directory: "{{.SourceDir}}/tests" + - type: ExecuteCommand + command: "ctest -V --rerun-failed" + ignoreExitCode: true + maxTimeInSeconds: 7200 + maxTimeBetweenOutput: 900 + userMessageOnFailure: > + Failed to run tests. +disable_if: + condition: property + property: configureArgs + contains_value: "-DBUILD_SHARED_LIBS=OFF" diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 565dd52554..75607753cc 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -4,127 +4,10 @@ accept_configuration: property: host.os equals_property: target.os -call_cmake_instructions: &call_cmake - type: Group - instructions: - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} {{.InstallDir}}\\bin\\qt-cmake {{.SourceDir}}/tests" - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 - userMessageOnFailure: > - Failed to call cmake. Contact Liang then. - enable_if: - condition: property - property: host.os - equals_value: Windows - - type: ExecuteCommand - command: "{{.InstallDir}}/bin/qt-cmake {{.SourceDir}}/tests" - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 - userMessageOnFailure: > - Failed to call cmake. Contact Liang then. - disable_if: - condition: property - property: host.os - equals_value: Windows - -build_and_upload_test_artifacts_instruction: &build_and_upload_test_artifacts - type: Group - instructions: - - type: ChangeDirectory - directory: "{{.SourceDir}}/tests" - - *call_cmake - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --build ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 - userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. Contact Liang first. - - type: UploadTestArtifact - transferType: UploadModuleTestsArtifact - archiveDirectory: "{{.SourceDir}}/tests" - maxTimeInSeconds: 1200 - maxTimeBetweenOutput: 1200 - disable_if: - condition: property - property: configureArgs - contains_value: "-DBUILD_SHARED_LIBS=OFF" - -regular_specific_test_instructions: ®ular_test_instructions - type: Group - instructions: - - type: InstallTestBinaryArchive - relativeStoragePath: "{{.Env.MODULE_ARTIFACTS_RELATIVE_STORAGE_PATH}}/tests.tar.gz" - directory: "{{.SourceDir}}/tests" - maxTimeInSeconds: 1200 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to install tests archive. - - type: ChangeDirectory - directory: "{{.SourceDir}}/tests" - - type: ExecuteCommand - command: "ctest -V --rerun-failed" - ignoreExitCode: true - maxTimeInSeconds: 7200 - maxTimeBetweenOutput: 900 - userMessageOnFailure: > - Failed to run tests. - disable_if: - condition: property - property: configureArgs - contains_value: "-DBUILD_SHARED_LIBS=OFF" - - build_instructions: - - type: MakeDirectory - directory: .git - - type: SetBuildDirectory - directory: "{{.SourceDir}}" - - type: ChangeDirectory - directory: "{{.BuildDir}}" - !include "{{qt/qtbase}}/prepare_building_env.yaml" - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF {{.SourceDir}}" - executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 - userMessageOnFailure: > - Failed to call cmake. Contact Liang then. - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --build ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 - userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. Contact Liang first. - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 - userMessageOnFailure: > - Failed to install package. - - type: EnvironmentVariable - variableName: DESTDIR - variableValue: "{{.InstallRoot}}" - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --install ." - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 - userMessageOnFailure: > - Failed to install package for archiving. - - type: SignPackage - enable_if: - condition: property - property: host.os - equals_value: Windows - directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" - maxTimeInSeconds: 1200 - maxTimeBetweenOutput: 1200 - - type: UploadArtifact - archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" - transferType: UploadModuleBuildArtifact - maxTimeInSeconds: 1200 - maxTimeBetweenOutput: 1200 - - *build_and_upload_test_artifacts + - !include "{{qt/qtbase}}/cmake_qtbase_build_instructions.yaml" + - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml" test_instructions: - - *regular_test_instructions + - !include "{{qt/qtbase}}/cmake_regular_test_instructions.yaml"