taskwarrior/.taskcluster.yml
2020-11-24 13:02:14 -05:00

98 lines
3 KiB
YAML

version: 1
reporting: checks-v1
policy:
pullRequests: public
tasks:
$if: 'tasks_for in ["github-push", "github-pull-request"]'
then:
$let:
run:
$if: 'tasks_for == "github-push"'
then: true
else: {$eval: 'event.action in ["opened", "reopened", "synchronize"]'}
repo_url:
$if: 'tasks_for == "github-push"'
then: ${event.repository.clone_url}
else: ${event.pull_request.head.repo.clone_url}
ref:
$if: 'tasks_for == "github-push"'
then: ${event.after}
else: ${event.pull_request.head.sha}
in:
- $if: run
then:
provisionerId: 'proj-misc'
workerType: 'ci'
deadline: {$fromNow: '1 hour'}
expires: {$fromNow: '1 day'}
payload:
maxRunTime: 3600
image: rust:latest
command:
- /bin/bash
- '-c'
- >-
rustup component add rustfmt &&
git clone ${repo_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${ref} &&
cargo test
metadata:
name: taskchampion-tests
description: Run tests for taskchampion
owner: dustin@v.igoro.us
source: ${repo_url}
- $if: run
then:
provisionerId: 'proj-misc'
workerType: 'ci'
deadline: {$fromNow: '1 hour'}
expires: {$fromNow: '1 day'}
payload:
maxRunTime: 3600
image: rust:latest
command:
- /bin/bash
- '-c'
- >-
rustup component add rustfmt &&
git clone ${repo_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${ref} &&
rustup component add clippy-preview &&
cargo clippy &&
cargo fmt -- --check
metadata:
name: taskchampion-clippy
description: Run clippy and rustfmt for taskchampion
owner: dustin@v.igoro.us
source: ${repo_url}
- $if: run
then:
provisionerId: 'proj-misc'
workerType: 'ci'
deadline: {$fromNow: '1 hour'}
expires: {$fromNow: '1 day'}
payload:
maxRunTime: 3600
image: rust:latest
command:
- /bin/bash
- '-c'
- >-
git clone ${repo_url} repo &&
cd repo &&
git config advice.detachedHead false &&
git checkout ${ref} &&
cd docs &&
curl -L --compressed https://github.com/rust-lang/mdBook/releases/download/v0.4.4/mdbook-v0.4.4-x86_64-unknown-linux-gnu.tar.gz | gunzip -c | tar -xf - &&
chmod +x mdbook &&
./mdbook test &&
./mdbook build
metadata:
name: taskchampion-book
description: Verify that the docs build with mdbook
owner: dustin@v.igoro.us
source: ${repo_url}