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"
|
|
|
|
|
2020-02-10 17:40:10 +03:00
|
|
|
taskboot_image: "mozilla/taskboot:0.2.2"
|
2019-08-26 18:50:57 +03:00
|
|
|
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
|
2022-10-27 13:09:38 +03:00
|
|
|
image: python:3.10
|
2019-08-26 18:50:57 +03:00
|
|
|
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 &&
|
2020-02-26 17:01:28 +03:00
|
|
|
cd /src && pre-commit run -a --show-diff-on-failure"
|
2019-08-26 18:50:57 +03:00
|
|
|
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
|
2022-10-27 13:09:38 +03:00
|
|
|
image: python:3.10
|
2019-08-26 18:50:57 +03:00
|
|
|
command:
|
|
|
|
- sh
|
|
|
|
- -lxce
|
2020-01-08 14:18:31 +03:00
|
|
|
- "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 &&
|
2020-01-08 14:18:31 +03:00
|
|
|
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
|
2020-02-10 17:40:10 +03:00
|
|
|
|
|
|
|
- $if: 'tag != "latest"'
|
|
|
|
then:
|
|
|
|
taskId: {$eval: as_slugid("release")}
|
|
|
|
created: {$fromNow: ''}
|
|
|
|
deadline: {$fromNow: '1 hour'}
|
|
|
|
provisionerId: proj-relman
|
|
|
|
workerType: ci
|
|
|
|
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"
|
|
|
|
command:
|
|
|
|
- taskboot
|
|
|
|
- github-release
|
|
|
|
- mozilla/libmozevent
|
|
|
|
- "${tag}"
|
|
|
|
scopes:
|
|
|
|
- "secrets:get:project/relman/libmozevent/deploy"
|
|
|
|
metadata:
|
|
|
|
name: "libmozevent publication on GitHub"
|
|
|
|
description: Publish release notes on GitHub
|
|
|
|
owner: bastien@mozilla.com
|
|
|
|
source: https://github.com/mozilla/libmozevent
|