119 строки
3.7 KiB
YAML
119 строки
3.7 KiB
YAML
version: 1
|
|
policy:
|
|
pullRequests: public
|
|
tasks:
|
|
$let:
|
|
user: ${event.sender.login}
|
|
|
|
head_branch:
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
then: ${event.pull_request.head.ref}
|
|
else:
|
|
$if: 'tasks_for == "github-push"'
|
|
then:
|
|
# Strip ref branch prefix
|
|
$if: 'event.ref[0:11] == "refs/heads/"'
|
|
then: ${event.ref[11:]}
|
|
else: ${event.ref}
|
|
else: ${event.release.target_commitish}
|
|
|
|
head_rev:
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
then: ${event.pull_request.head.sha}
|
|
else:
|
|
$if: 'tasks_for == "github-push"'
|
|
then: ${event.after}
|
|
else: ${event.release.tag_name}
|
|
|
|
repository:
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
then: ${event.pull_request.head.repo.html_url}
|
|
else: ${event.repository.html_url}
|
|
in:
|
|
- taskId: { $eval: as_slugid("tests_task") }
|
|
created: { $fromNow: "" }
|
|
deadline: { $fromNow: "1 hour" }
|
|
provisionerId: proj-mozci
|
|
workerType: ci
|
|
payload:
|
|
maxRunTime: 3600
|
|
image: python:3.10
|
|
command:
|
|
- "/bin/bash"
|
|
- "-lcx"
|
|
- "git clone --quiet ${repository} &&
|
|
cd mozci &&
|
|
git -c advice.detachedHead=false checkout ${head_rev} &&
|
|
pip install --quiet tox==3.28.0 &&
|
|
tox"
|
|
metadata:
|
|
name: mozci linting and tests
|
|
description: mozci linting and tests
|
|
owner: mcastelluccio@mozilla.com
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
|
|
|
- taskId: { $eval: as_slugid("docker_build") }
|
|
created: { $fromNow: "" }
|
|
deadline: { $fromNow: "1 hour" }
|
|
dependencies:
|
|
- { $eval: as_slugid("tests_task") }
|
|
provisionerId: proj-mozci
|
|
workerType: generic-worker-ubuntu-24-04
|
|
payload:
|
|
maxRunTime: 3600
|
|
command:
|
|
- - bash
|
|
- "-cx"
|
|
- >-
|
|
podman run -v $(pwd):/work -w /work --privileged -e
|
|
"GIT_REPOSITORY=${repository}" -e
|
|
"GIT_REVISION=${head_rev}"
|
|
'mozilla/taskboot:0.3.6' taskboot build --build-tool podman --image
|
|
mozilla/mozci --tag ${head_rev} --write
|
|
'/work/mozci.tar' Dockerfile
|
|
artifacts:
|
|
- name: public/mozci.tar.zst
|
|
expires:
|
|
$if: 'head_branch == "production"'
|
|
then: { $fromNow: "1 year" }
|
|
else: { $fromNow: "1 month" }
|
|
path: mozci.tar.zst
|
|
type: file
|
|
routes:
|
|
$if: 'tasks_for == "github-pull-request"'
|
|
then:
|
|
- "index.project.mozci.docker-pr.revision.${head_rev}"
|
|
- "index.project.mozci.docker-pr.branch.${head_branch}"
|
|
else:
|
|
- "index.project.mozci.docker.revision.${head_rev}"
|
|
- "index.project.mozci.docker.branch.${head_branch}"
|
|
metadata:
|
|
name: mozci docker build
|
|
description: mozci docker build
|
|
owner: mcastelluccio@mozilla.com
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|
|
|
|
- taskId: { $eval: as_slugid("docker_test") }
|
|
created: { $fromNow: "" }
|
|
deadline: { $fromNow: "1 hour" }
|
|
dependencies:
|
|
- { $eval: as_slugid("docker_build") }
|
|
provisionerId: proj-mozci
|
|
workerType: ci
|
|
payload:
|
|
maxRunTime: 3600
|
|
image:
|
|
type: task-image
|
|
path: public/mozci.tar.zst
|
|
taskId: { $eval: as_slugid("docker_build") }
|
|
env:
|
|
GIT_REPOSITORY: ${repository}
|
|
GIT_REVISION: ${head_rev}
|
|
command:
|
|
- help
|
|
metadata:
|
|
name: mozci docker test
|
|
description: mozci docker test
|
|
owner: mcastelluccio@mozilla.com
|
|
source: ${repository}/raw/${head_rev}/.taskcluster.yml
|