-
Notifications
You must be signed in to change notification settings - Fork 12
/
.taskcluster.yml
127 lines (121 loc) · 3.83 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
version: 1
policy:
pullRequests: collaborators
tasks:
$let:
user: ${event.sender.login}
project_name:
Fuzzfetch
fetch_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}
http_repo:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.base.repo.clone_url}
else: ${event.repository.clone_url}
matrix:
language: python
secrets:
- type: env
secret: project/fuzzing/codecov-fuzzfetch
name: CODECOV_TOKEN
key: token
script:
- bash
- '-xec'
- tox; tox -e codecov
jobs:
include:
- name: tests python 3.9
version: "3.9"
env:
TOXENV: py39,lint
- name: tests python 3.10
version: "3.10"
env:
TOXENV: py310,lint
- name: tests python 3.11
version: "3.11"
env:
TOXENV: py311,lint
- name: tests python 3.12
version: "3.12"
env:
TOXENV: py312,lint
- name: PyPI upload
version: "3.11"
env:
TOXENV: pypi
script:
- tox
when:
release: true
all_passed: true
secrets:
- type: env
secret: project/fuzzing/pypi-fuzzfetch
name: TWINE_USERNAME
key: username
- type: env
secret: project/fuzzing/pypi-fuzzfetch
name: TWINE_PASSWORD
key: password
# Filter github event to only necessary fields.
# Since we use a large list of test fixtures, broad changes can exceed
# Docker environment variable size limits.
gh_event:
sender: {$eval: event.sender}
repository: {$eval: event.repository}
before: {$eval: "event['before']"}
after: {$eval: "event['after']"}
number: {$eval: "event['number']"}
release: {$eval: "event['release']"}
ref: {$eval: "event['ref']"}
pull_request:
$if: 'tasks_for == "github-pull-request"'
then:
head: {$eval: event.pull_request.head}
base: {$eval: event.pull_request.base}
in:
$if: >
(tasks_for == "github-push")
|| (tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"])
|| (tasks_for == "github-release" && event["action"] in ["published"])
then:
- created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
provisionerId: proj-fuzzing
workerType: decision
payload:
features:
taskclusterProxy: true
maxRunTime: 3600
image:
type: indexed-image
path: public/orion-decision.tar.zst
namespace: project.fuzzing.orion.orion-decision.master
env:
PROJECT_NAME: ${project_name}
CI_MATRIX: {$json: {$eval: matrix}}
GITHUB_EVENT: {$json: {$eval: gh_event}}
GITHUB_ACTION: ${tasks_for}
TASKCLUSTER_NOW: ${now}
command:
- ci-decision
- -v
scopes:
- queue:create-task:highest:proj-fuzzing/ci
- queue:create-task:highest:proj-fuzzing/ci-*
- queue:scheduler-id:taskcluster-github
- secrets:get:project/fuzzing/codecov-fuzzfetch
- secrets:get:project/fuzzing/pypi-fuzzfetch
metadata:
name: ${project_name} CI decision
description: Schedule CI tasks for ${project_name}
owner: '${user}@users.noreply.github.com'
source: ${http_repo}/raw/${fetch_rev}/.taskcluster.yml
else: []