diff --git a/.taskcluster.yml b/.taskcluster.yml index c2f3126b8..9ba0811ca 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -45,6 +45,7 @@ tasks: - ['treescript', '37', '', ''] - ['treescript', '38', '', 'mozilla/releng-treescript'] - ['pypiscript', '38', '', 'mozilla/releng-pypiscript'] + - ['rust', 'rust', '', ''] # ------------------------------------------------------------------------- HEAD_REV: @@ -69,6 +70,8 @@ tasks: $if: 'tasks_for == "github-push" && event.ref[0:11] == "refs/heads/"' then: '${event.ref[11:]}' else: 'unknown' + + rust_version: 1.43 in: $flatten: $map: { "$eval": "PROJECTS" } @@ -116,7 +119,7 @@ tasks: in: $match: # Run code linting and unit tests for each project - 'run_tests == "1"': + 'run_tests == "1" && project_name != "rust"': taskId: '${as_slugid(project_name + python_version)}' provisionerId: 'releng-t' workerType: 'linux' @@ -148,6 +151,39 @@ tasks: description: 'Code linting and unit tests for ${project_name} on python ${python_version[0]}.${python_version[1]}' owner: '${OWNER}' source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml' + 'run_tests == "1" && project_name == "rust"': + taskId: '${as_slugid("rust")}' + provisionerId: 'releng-t' + workerType: 'linux' + created: { $fromNow: '' } + deadline: { $fromNow: '4 hours' } + payload: + maxRunTime: 3600 + image: 'rust:${rust_version}' + command: + - sh + - -xce + - >- + cd /tmp && + wget ${REPO_URL}/archive/${HEAD_REV}.tar.gz && + tar zxf ${HEAD_REV}.tar.gz && + mv scriptworker-scripts-${HEAD_REV} /src && + cd /src && ${setup_command} + cargo test && cargo clippy + pip install tox && + tox -e ${project_name}-py${python_version} + metadata: + name: + $let: + test_task_number: + $if: 'dockerhub_repo != ""' + then: '${i+1}.1' + else: '${i+1}' + in: + '${number_prefix}${test_task_number}. ${project_name}: Run rust checks [on ${BRANCH_NAME}]' + description: 'Code linting and unit tests for rust code on rust ${rust_version}' + owner: '${OWNER}' + source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml' # Build docker image and (optionally) push to docker hub 'run_tests == "1" && dockerhub_repo != ""': taskId: '${as_slugid(project_name + "docker_build_and_push")}'