libmozevent/.taskcluster.yml

120 строки
3.7 KiB
YAML
Исходник Обычный вид История

2019-08-26 18:50:57 +03:00
version: 1
policy:
pullRequests: public
tasks:
$let:
head_branch:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.ref}
else:
$if: 'tasks_for == "github-push"'
then: ${event.ref}
else: ${event.release.target_commitish}
head_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}
repository:
$if: 'tasks_for == "github-pull-request"'
then: ${event.pull_request.head.repo.html_url}
else: ${event.repository.html_url}
channel:
$if: 'tasks_for == "github-push"'
then:
$if: 'event.ref in ["refs/heads/testing", "refs/heads/production"]'
then: ${event.ref[11:]}
else: 'dev'
else: 'dev'
tag:
$if: 'tasks_for == "github-push"'
then:
$if: 'event.ref[:10] == "refs/tags/"'
then: {$eval: 'event.ref[10:]' }
else: "latest"
else: "latest"
taskboot_image: "mozilla/taskboot:0.1.10"
in:
- taskId: {$eval: as_slugid("check_lint")}
2019-11-11 22:04:06 +03:00
provisionerId: proj-relman
workerType: ci
2019-08-26 18:50:57 +03:00
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
payload:
maxRunTime: 3600
image: python:3
command:
- sh
- -lxce
- "git clone --quiet ${repository} /src && cd /src && git checkout ${head_rev} -b checks &&
pip install -q . && pip install -q -r requirements-dev.txt &&
cd /src && pre-commit run -a"
metadata:
name: "libmozevent checks: linting"
description: Check code style with pre-commit hooks
owner: bastien@mozilla.com
source: https://github.com/mozilla/libmozevent
- taskId: {$eval: as_slugid("check_tests")}
2019-11-11 22:04:06 +03:00
provisionerId: proj-relman
workerType: ci
2019-08-26 18:50:57 +03:00
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
payload:
maxRunTime: 3600
image: python:3
command:
- sh
- -lxce
- "apt-get -qq update &&
apt-get -qq install -y redis-server &&
git clone --quiet ${repository} /src && cd /src && git checkout ${head_rev} -b checks &&
2019-08-26 18:50:57 +03:00
pip install -q . && pip install -q -r requirements-dev.txt &&
/src/docker/bootstrap.sh &&
pytest -v &&
export REDIS_URL='redis://localhost:6379/' &&
redis-server --daemonize yes &&
2019-08-26 18:50:57 +03:00
pytest -v"
metadata:
name: "libmozevent checks: unit tests"
description: Check python code with pytest
owner: bastien@mozilla.com
source: https://github.com/mozilla/libmozevent
- $if: 'tag != "latest"'
then:
taskId: {$eval: as_slugid("publish")}
created: {$fromNow: ''}
deadline: {$fromNow: '1 hour'}
2019-11-11 22:04:06 +03:00
provisionerId: proj-relman
workerType: ci
2019-08-26 18:50:57 +03:00
dependencies:
- {$eval: as_slugid("check_lint")}
- {$eval: as_slugid("check_tests")}
payload:
features:
taskclusterProxy: true
maxRunTime: 3600
image: "${taskboot_image}"
env:
TASKCLUSTER_SECRET: "project/relman/libmozevent/deploy"
GIT_REPOSITORY: "${repository}"
GIT_REVISION: "${head_rev}"
command:
- taskboot
- deploy-pypi
scopes:
- "secrets:get:project/relman/libmozevent/deploy"
metadata:
name: "libmozevent publication on PyPi"
description: Publish new version on PyPi
owner: bastien@mozilla.com
source: https://github.com/mozilla/libmozevent