Skip to content

Commit

Permalink
rust test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomprince committed May 10, 2020
1 parent 1de5187 commit a43f980
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ tasks:
- ['treescript', '37', '', '']
- ['treescript', '38', '', 'mozilla/releng-treescript']
- ['pypiscript', '38', '', 'mozilla/releng-pypiscript']
- ['rust', 'rust', '', '']
# -------------------------------------------------------------------------

HEAD_REV:
Expand All @@ -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" }
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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")}'
Expand Down

0 comments on commit a43f980

Please sign in to comment.