-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.taskcluster.yml
94 lines (92 loc) · 2.97 KB
/
.taskcluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# This file is rendered via JSON-e by
# - mozilla-taskcluster - https://docs.taskcluster.net/reference/integrations/mozilla-taskcluster/docs/taskcluster-yml
# - cron tasks - taskcluster/taskgraph/cron/decision.py
# - action tasks - taskcluster/taskgraph/actions/registry.py
---
version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$let:
owner: [email protected]
# This only supports pushes and pull requests for now.
# If we start responding to another action type, make this
# a $match.
repo:
$if: 'tasks_for == "github-push"'
then:
git_url: ${event.repository.url}
url: ${event.repository.url}
ref: ${event.after}
else:
$if: 'tasks_for == "github-pull-request"'
then:
git_url: ${event.pull_request.head.repo.clone_url}
url: ${event.pull_request.head.repo.url}
ref: ${event.pull_request.head.sha}
else:
git_url: ${event.repository.url}
url: ${event.repository.url}
ref: ${event.release.tag_name}
in:
$let:
tests:
- image: 'python:3.11'
name: python:3.11 tests
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.git_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
pip install -e . &&
python setup.py test
- image: 'python:3.11'
name: flake
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.git_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
pip install -e . &&
pip install flake8 &&
flake8 tcadmin
in:
$let:
test_tasks:
$map: {$eval: tests}
each(test):
taskId: {$eval: as_slugid(test.name)}
provisionerId: proj-taskcluster
workerType: ci
created: {$fromNow: ''}
deadline: {$fromNow: '60 minutes'}
payload:
maxRunTime: 3600
image: ${test.image}
command: {$eval: 'test.command'}
env:
NO_TEST_SKIP: "1"
metadata:
name: ${test.name}
description: ${test.name}
owner: ${owner}
source: ${repo.url}
in:
$flattenDeep:
- $if: 'tasks_for == "github-push"'
then:
- {$eval: test_tasks}
- $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"]'
then:
# We can skip this if pushed to our own repo since push event will get it
$if: 'event.pull_request.base.repo.id != event.pull_request.head.repo.id'
then: {$eval: test_tasks}