forked from taskcluster/community-tc-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.taskcluster.yml
93 lines (92 loc) · 2.86 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
version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$let:
owner: [email protected]
repo:
$if: 'tasks_for == "github-push"'
then:
clone_url: ${event.repository.url}
url: ${event.repository.url}
ref: ${event.after}
else:
$if: 'tasks_for == "github-pull-request"'
then:
clone_url: ${event.pull_request.head.repo.clone_url}
url: ${event.pull_request.head.repo.url}
ref: ${event.pull_request.head.sha}
else:
clone_url: ${event.repository.url}
url: ${event.repository.url}
ref: ${event.release.tag_name}
in:
$let:
tests:
- image: 'python:3.11'
name: tc-admin diff
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.clone_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
pip install --no-use-pep517 -e . &&
tc-admin generate --without-secrets >/dev/null &&
{ tc-admin diff --without-secrets | cat; true; }
- image: 'python:3.11'
name: black
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.clone_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
pip install black &&
black --diff generate &&
black --check generate
- image: 'python:3.11'
name: yamllint
command:
- /bin/bash
- '--login'
- '-c'
- >-
git clone ${repo.clone_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${repo.ref} &&
pip install yamllint &&
yamllint config
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'}
metadata:
name: ${test.name}
description: ${test.name}
owner: ${owner}
source: ${repo.url}
in:
$flattenDeep:
- $if: 'tasks_for == "github-push" && event["ref"] == "refs/heads/main"'
then: {$eval: test_tasks}
- $if: 'tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"]'
then: {$eval: test_tasks}