microannotate/.taskcluster.yml

154 строки
5.4 KiB
YAML

version: 1
policy:
pullRequests: public
tasks:
$let:
user: ${event.sender.login}
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}
taskboot_image: "mozilla/taskboot:0.1.10"
in:
$if: 'tasks_for == "github-push" || (tasks_for == "github-pull-request" && event["action"] in ["opened", "reopened", "synchronize"])'
then:
- taskId: { $eval: as_slugid("lint_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-relman
workerType: ci
payload:
maxRunTime: 3600
image: python:3.8
command:
- "/bin/bash"
- "-lcx"
- "git clone --quiet ${repository} &&
cd microannotate &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip install --quiet -r test-requirements.txt &&
pre-commit run -a --show-diff-on-failure"
metadata:
name: microannotate lint
description: microannotate lint
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: { $eval: as_slugid("packaging_test_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-relman
workerType: ci
payload:
maxRunTime: 3600
image: python:3.8
command:
- "/bin/bash"
- "-lcx"
- "git clone --quiet ${repository} &&
cd microannotate &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python setup.py sdist &&
pip install dist/microannotate-$(cat VERSION).tar.gz"
metadata:
name: microannotate packaging test
description: microannotate packaging test
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push"'
then:
taskId: { $eval: as_slugid("version_check_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-relman
workerType: ci
payload:
maxRunTime: 3600
image: python:3.8
command:
- "/bin/bash"
- "-lcx"
- "git clone --quiet ${repository} &&
cd microannotate &&
git -c advice.detachedHead=false checkout ${head_rev} &&
python infra/version_check.py"
metadata:
name: microannotate tag version check
description: microannotate tag version check
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- taskId: { $eval: as_slugid("tests_task") }
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-relman
workerType: ci
payload:
maxRunTime: 3600
image: python:3.8
command:
- "/bin/bash"
- "-lcx"
- "curl -L https://github.com/mozilla/rust-code-analysis/releases/download/v0.0.19/rust-code-analysis-linux-web-x86_64.tar.gz | tar -C /usr/bin -xzv &&
git clone --quiet ${repository} &&
cd microannotate &&
git -c advice.detachedHead=false checkout ${head_rev} &&
pip install --quiet -r requirements.txt &&
pip install --quiet -r test-requirements.txt &&
python -m pytest -s -vv tests/test_*.py"
metadata:
name: microannotate tests
description: microannotate tests
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml
- $if: 'tasks_for == "github-push" && head_branch[:10] == "refs/tags/"'
then:
dependencies:
- { $eval: as_slugid("lint_task") }
- { $eval: as_slugid("packaging_test_task") }
- { $eval: as_slugid("version_check_task") }
- { $eval: as_slugid("tests_task") }
scopes:
- secrets:get:project/relman/microannotate/deploy
created: { $fromNow: "" }
deadline: { $fromNow: "1 hour" }
provisionerId: proj-relman
workerType: ci
payload:
features:
taskclusterProxy: true
maxRunTime: 3600
image: "${taskboot_image}"
command:
- taskboot
- deploy-pypi
env:
TASKCLUSTER_SECRET: project/relman/microannotate/deploy
GIT_REPOSITORY: "${repository}"
GIT_REVISION: "${head_rev}"
metadata:
name: microannotate PyPI release
description: microannotate PyPI release
owner: mcastelluccio@mozilla.com
source: ${repository}/raw/${head_rev}/.taskcluster.yml