Skip to content

Commit 9205b53

Browse files
committed
feat(ci): connect repo to Community-TC
1 parent 1fc8f5f commit 9205b53

File tree

5 files changed

+119
-6
lines changed

5 files changed

+119
-6
lines changed

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Style/StringLiterals:
2+
Enabled: false
3+
4+
AllCops:
5+
NewCops: enable

.taskcluster.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
version: 1
2+
reporting: checks-v1
3+
policy:
4+
pullRequests: public
5+
tasks:
6+
$let:
7+
head_rev:
8+
$if: tasks_for == "github-pull-request"
9+
then: ${event.pull_request.head.sha}
10+
else: ${event.after}
11+
repository:
12+
$if: tasks_for == "github-pull-request"
13+
then: ${event.pull_request.head.repo.html_url}
14+
else: ${event.repository.html_url}
15+
in:
16+
$let:
17+
tests:
18+
- image: ruby:alpine
19+
name: lint with RuboCop
20+
command:
21+
- /bin/sh
22+
- '--login'
23+
- '-c'
24+
- >-
25+
git clone ${repository} repo &&
26+
cd repo &&
27+
git config advice.detachedHead false &&
28+
git checkout ${head_rev} &&
29+
bundle install &&
30+
rubocop
31+
- image: homebrew/brew
32+
name: brew {audit, test, install}
33+
command:
34+
- /bin/bash
35+
- '--login'
36+
- '-c'
37+
- >-
38+
git clone ${repository} repo &&
39+
cd repo &&
40+
git config advice.detachedHead false &&
41+
git checkout ${head_rev} &&
42+
brew audit --strict ./Formula/taskcluster.rb &&
43+
brew test ./Formula/taskcluster.rb &&
44+
brew install ./Formula/taskcluster.rb
45+
in:
46+
$let:
47+
test_tasks:
48+
$map: {$eval: tests}
49+
each(test):
50+
taskId: {$eval: as_slugid(test.name)}
51+
taskQueueId: proj-taskcluster/ci
52+
created: {$fromNow: ''}
53+
deadline: {$fromNow: '1 hour'}
54+
payload:
55+
maxRunTime: 3600
56+
image: ${test.image}
57+
command: {$eval: 'test.command'}
58+
metadata:
59+
name: ${test.name}
60+
description: ${test.name}
61+
62+
source: ${repository}
63+
in:
64+
$match:
65+
(tasks_for == "github-pull-request" && event["action"] in ["opened","reopened","synchronize"]):
66+
$flattenDeep: {$eval: test_tasks}

Formula/taskcluster.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
# frozen_string_literal: true
2+
3+
# Homebrew formula for taskcluster CLI
14
class Taskcluster < Formula
2-
desc "A Taskcluster client library for the command line"
5+
desc "Client library for the Taskcluster CLI"
36
homepage "https://github.com/taskcluster/taskcluster/tree/main/clients/client-shell"
4-
version "v44.17.2"
7+
version "44.17.2"
58
license "MPL-2.0"
69

710
if OS.mac?
811
if Hardware::CPU.physical_cpu_arm64?
9-
url "https://github.com/taskcluster/taskcluster/releases/download/#{version}/taskcluster-darwin-arm64", :using => :curl
12+
url "https://github.com/taskcluster/taskcluster/releases/download/v#{version}/taskcluster-darwin-arm64"
1013
sha256 "1ccf56972988f45c88e9a21a536728f1064eabef49a9d085e16ac41db14214a5"
1114
else
12-
url "https://github.com/taskcluster/taskcluster/releases/download/#{version}/taskcluster-darwin-amd64", :using => :curl
15+
url "https://github.com/taskcluster/taskcluster/releases/download/v#{version}/taskcluster-darwin-amd64"
1316
sha256 "7897baf6c27350e5a6fe46e93f9bb4890f5dd98a117196acfb4267e639624a5c"
1417
end
1518
elsif OS.linux?
16-
url "https://github.com/taskcluster/taskcluster/releases/download/#{version}/taskcluster-linux-amd64", :using => :curl
19+
url "https://github.com/taskcluster/taskcluster/releases/download/v#{version}/taskcluster-linux-amd64"
1720
sha256 "d12b40c048e96bd5376f9d28c4831075ee6b74b3c8b9bd3d85f57cc1a9ec1971"
1821
end
1922

@@ -30,6 +33,6 @@ def install
3033
end
3134

3235
test do
33-
system "#{bin}/taskcluster --help"
36+
system "#{bin}/taskcluster", "--help"
3437
end
3538
end

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
source 'https://rubygems.org'
4+
5+
gem 'rubocop', require: false

Gemfile.lock

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ast (2.4.2)
5+
json (2.6.2)
6+
parallel (1.22.1)
7+
parser (3.1.2.0)
8+
ast (~> 2.4.1)
9+
rainbow (3.1.1)
10+
regexp_parser (2.5.0)
11+
rexml (3.2.5)
12+
rubocop (1.32.0)
13+
json (~> 2.3)
14+
parallel (~> 1.10)
15+
parser (>= 3.1.0.0)
16+
rainbow (>= 2.2.2, < 4.0)
17+
regexp_parser (>= 1.8, < 3.0)
18+
rexml (>= 3.2.5, < 4.0)
19+
rubocop-ast (>= 1.19.1, < 2.0)
20+
ruby-progressbar (~> 1.7)
21+
unicode-display_width (>= 1.4.0, < 3.0)
22+
rubocop-ast (1.19.1)
23+
parser (>= 3.1.1.0)
24+
ruby-progressbar (1.11.0)
25+
unicode-display_width (2.2.0)
26+
27+
PLATFORMS
28+
arm64-darwin-21
29+
30+
DEPENDENCIES
31+
rubocop
32+
33+
BUNDLED WITH
34+
2.3.11

0 commit comments

Comments
 (0)