From 0e792ad58433a417c42f29061db728852e310804 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sat, 21 Nov 2020 18:48:26 -0500 Subject: [PATCH 1/2] use a v1 .taskcluster.yml --- .taskcluster.yml | 72 +++++++++++++++++++++++++++++------------------- src/task/mod.rs | 4 +-- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/.taskcluster.yml b/.taskcluster.yml index d6406c4ac..07e8fe02b 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -1,29 +1,45 @@ -version: 0 +version: 1 +reporting: checks-v1 +policy: + pullRequests: public tasks: - - provisionerId: '{{ taskcluster.docker.provisionerId }}' - workerType: '{{ taskcluster.docker.workerType }}' - extra: - github: - events: - - pull_request.opened - - pull_request.reopened - - pull_request.synchronize - - push - payload: - maxRunTime: 3600 - image: 'rust:latest' - command: - - /bin/bash - - '-c' - - >- - git clone {{event.head.repo.url}} repo && - cd repo && - git config advice.detachedHead false && - git checkout {{event.head.sha}} && - cargo test - metadata: - name: Test - description: 'Run tests' - owner: '{{ event.head.user.email }}' - source: '{{ event.head.repo.url }}' -allowPullRequests: collaborators + $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' + - >- + git clone ${repo_url} repo && + cd repo && + git config advice.detachedHead false && + git checkout ${ref} && + cargo test && + cargo fmt -- --check + metadata: + name: taskchampion-tests + description: Run tests for taskchampion + owner: dustin@v.igoro.us + source: ${repo_url} diff --git a/src/task/mod.rs b/src/task/mod.rs index 6587458ba..f22b30c70 100644 --- a/src/task/mod.rs +++ b/src/task/mod.rs @@ -1,7 +1,7 @@ mod task; mod taskbuilder; -pub use self::taskbuilder::TaskBuilder; -pub use self::task::{Task, Priority, Status, Timestamp, Annotation}; pub use self::task::Priority::*; pub use self::task::Status::*; +pub use self::task::{Annotation, Priority, Status, Task, Timestamp}; +pub use self::taskbuilder::TaskBuilder; From c8a28b5ab37dff17d40a6c7a5ed3f483d4e483e2 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sat, 21 Nov 2020 19:09:55 -0500 Subject: [PATCH 2/2] install rustfmt --- .taskcluster.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.taskcluster.yml b/.taskcluster.yml index 07e8fe02b..37cb4a98f 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -32,6 +32,7 @@ tasks: - /bin/bash - '-c' - >- + rustup component add rustfmt && git clone ${repo_url} repo && cd repo && git config advice.detachedHead false &&