-
Notifications
You must be signed in to change notification settings - Fork 82
/
.taskcluster.yml
138 lines (136 loc) · 4.42 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
128
129
130
131
132
133
134
135
136
137
138
version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$let:
owner: taskcluster-internal@mozilla.com
# 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:
url: ${event.repository.url}
ref: ${event.after}
else:
url: ${event.pull_request.head.repo.html_url}
ref: ${event.pull_request.head.sha}
in:
$let:
environments:
$flatten:
- $map:
- {vers: 18}
- {vers: 20}
- {vers: 21}
each(v):
image: node:${v.vers}
name: Node ${v.vers} tests
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
cd js &&
yarn &&
yarn test
- $map:
- {env: py38, vers: "3.8"}
- {env: py39, vers: "3.9"}
- {env: py310, vers: "3.10"}
- {env: py311, vers: "3.11"}
each(v):
image: 'python:${v.vers}'
name: Python ${v.vers} tests
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
cd py/ &&
pip install tox &&
tox -e ${v.env}
# This image generally tracks the latest Go
- image: 'golangci/golangci-lint'
name: Go tests (and lint)
command:
- /bin/bash
- '-c'
- >-
git clone ${repo.url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
go get -v -d -t ./... &&
go test -v -race ./... &&
golangci-lint run
- $map:
# This serves as an informal MSRV, just to check that the crate still
# compiles with the older Rust version. It is fine to bump this
# as-needed, as long as about a years' worth of Rust releases are
# still supported.
- {vers: "1.60"}
- {vers: "latest"}
each(v):
image: 'rust:${v.vers}'
name: Rust ${v.vers} tests
command:
- /bin/bash
- '-c'
- >-
git clone ${repo.url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
cd rs/ &&
cargo test
# Always use the latest Rust for the mdbook tests
- image: 'rust:latest'
name: MdBook tests
command:
- /bin/bash
- '-c'
- >-
git clone ${repo.url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
curl -ssL https://github.com/rust-lang/mdBook/releases/download/v0.4.15/mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz | tar -zxf - &&
./mdbook test
in:
$let:
tests:
$map: {$eval: environments}
each(env):
taskId: {$eval: as_slugid(env.name)}
provisionerId: proj-taskcluster
workerType: ci
created: {$fromNow: ''}
deadline: {$fromNow: '60 minutes'}
payload:
maxRunTime: 3600
image: ${env.image}
command: {$eval: 'env.command'}
metadata:
name: ${env.name}
description: ${env.name}
owner: ${owner}
source: ${repo.url}
in:
$flattenDeep:
- $if: 'tasks_for == "github-push"'
then: {$eval: tests}
- $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: tests}