diff options
Diffstat (limited to 'tools/run_tests/artifact_targets.py')
-rw-r--r-- | tools/run_tests/artifact_targets.py | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index d0aee7dda3..317111e4df 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -183,16 +183,49 @@ class CSharpExtArtifact: def __str__(self): return self.name +node_gyp_arch_map = { + 'x86': 'ia32', + 'x64': 'x64' +} + +class NodeExtArtifact: + """Builds Node native extension""" + + def __init__(self, platform, arch): + self.name = 'node_ext_{0}_{1}'.format(platform, arch) + self.platform = platform + self.arch = arch + self.gyp_arch = node_gyp_arch_map[arch] + self.labels = ['artifact', 'node', platform, arch] + + def pre_build_jobspecs(self): + return [] + + def build_jobspec(self): + if self.platform == 'windows': + return create_jobspec(self.name, + ['tools\\run_tests\\build_artifact_node.bat', + self.gyp_arch], + shell=True) + else: + if self.platform == 'linux': + return create_docker_jobspec( + self.name, + 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), + 'tools/run_tests/build_artifact_node.sh {}'.format(self.gyp_arch)) + else: + return create_jobspec(self.name, + ['tools/run_tests/build_artifact_node.sh', + self.gyp_arch]) + def targets(): """Gets list of supported targets""" - return [CSharpExtArtifact('linux', 'x86'), - CSharpExtArtifact('linux', 'x64'), - CSharpExtArtifact('macos', 'x86'), - CSharpExtArtifact('macos', 'x64'), - CSharpExtArtifact('windows', 'x86'), - CSharpExtArtifact('windows', 'x64'), - PythonArtifact('linux', 'x86'), - PythonArtifact('linux', 'x64'), - RubyArtifact('linux', 'x86'), - RubyArtifact('linux', 'x64')] + return ([Cls(platform, arch) + for Cls in (CSharpExtArtifact, NodeExtArtifact) + for platform in ('linux', 'macos', 'windows') + for arch in ('x86', 'x64')] + + [PythonArtifact('linux', 'x86'), + PythonArtifact('linux', 'x64'), + RubyArtifact('linux', 'x86'), + RubyArtifact('linux', 'x64')]) |