-
Notifications
You must be signed in to change notification settings - Fork 6
/
.taskcluster.yml
62 lines (58 loc) · 2.14 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
version: 1
policy:
pullRequests: public
tasks:
$let:
head_rev:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.head.sha}
else: ${event.after}
repository:
$if: tasks_for == "github-pull-request"
then: ${event.pull_request.head.repo.html_url}
else: ${event.repository.html_url}
head_branch:
$switch:
'tasks_for[:19] == "github-pull-request"': ${event.pull_request.head.ref}
'tasks_for == "github-push"': ${event.ref}
'tasks_for == "github-release"': "${event.release.target_commitish}"
'tasks_for in ["action", "cron"]': "${push.branch}"
pullRequestAction:
$switch:
'tasks_for[:19] == "github-pull-request"': ${event.action}
$default: "UNDEFINED"
isPullRequest:
$eval: 'tasks_for[:19] == "github-pull-request"'
in:
$if: >
(tasks_for == "github-push" && head_branch == "refs/heads/master")
|| (isPullRequest && pullRequestAction in ["opened", "reopened", "synchronize"])
then:
- taskId:
$eval: as_slugid("test")
deadline:
$fromNow: 1 hour
taskQueueId: proj-misc/tutorial
metadata:
name: crash-clouseau linting and tests
description: Taskcluster definition for crash-clouseau
owner: ${event.sender.login}@users.noreply.github.com
source: ${event.repository.url}
payload:
maxRunTime: 3600
image: python:3.10
env:
CODECOV_TOKEN: 2074f917-03ff-4f90-bafd-1fb186e42216
DATABASE_URL: postgres://clouseau2:passwd@localhost:5432/clouseau
REDIS_URL: redis://localhost:6379
command:
- /bin/bash
- "-lcx"
- >
git clone ${repository} repo && cd repo &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip install --quiet -r requirements.txt &&
pip install --quiet -r test-requirements.txt &&
flake8 . &&
coverage run --source=crashclouseau -m unittest discover tests/ --verbose &&
bash <(curl -s https://codecov.io/bash)