gotsha 0.1.1 → 0.1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/gotsha/actions/commit.rb +2 -0
- data/lib/gotsha/actions/help.rb +8 -1
- data/lib/gotsha/actions/init.rb +2 -0
- data/lib/gotsha/actions/show.rb +2 -0
- data/lib/gotsha/actions/status.rb +2 -0
- data/lib/gotsha/actions/test.rb +2 -0
- data/lib/gotsha/actions/uninstall.rb +2 -0
- data/lib/gotsha/user_config.rb +9 -5
- data/lib/gotsha/version.rb +1 -1
- data/web/index.html +25 -19
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1d7397971db70f600ade732a86bf88b71b8f93cb2e9e4ac593f69485b4343bc5
|
|
4
|
+
data.tar.gz: d8c9850d30847f9a74672b097112a0e635102aa7eeb6038de4943342c406338a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b584f3537af0b193c9489b65b44f32e5c88cbd22da74739a541bedaee3be066896592a84c13512647f57b6192a453d857ee56f3551ccf33d73c59bad91455ed
|
|
7
|
+
data.tar.gz: 98b9823534a3e9808ac44c991201cad0a1d86160050b177ab5ff43fc8a636f85fed183618e8da56aa9ccd715e9a106ce7f9dff4062505febcc678fc48ec30992
|
data/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
# Gotsha — your local CI (alpha
|
|
1
|
+
# Gotsha — your local testing CI (alpha version)
|
|
2
2
|
Pushing untested commits? Gotsha!
|
|
3
3
|
|
|
4
|
+
## Installation
|
|
5
|
+
```bash
|
|
6
|
+
gem install gotsha # or add `gem "gotsha"` to you Gemfile and run `bundle install`
|
|
7
|
+
|
|
8
|
+
gotsha
|
|
9
|
+
```
|
|
10
|
+
Then just follow the prompts — Gotsha will guide you through the setup. It won't take more than 3 minutes!
|
|
11
|
+
|
|
4
12
|
## What is it?
|
|
5
13
|
Gotsha is a tiny tool that lets you “sign off” your commit locally: it runs your tests and then stores the test results with the commit SHA (hence the gem name: got-SHA). Your pull request can then be verified against that record, so reviewers know you actually ran the checks before asking for review.
|
|
6
14
|
|
data/lib/gotsha/actions/help.rb
CHANGED
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
module Gotsha
|
|
4
4
|
module Actions
|
|
5
5
|
class Help
|
|
6
|
+
DESCRIPTION = "shows available commands"
|
|
7
|
+
|
|
6
8
|
def call
|
|
7
|
-
commands = Gotsha::Actions.constants.map
|
|
9
|
+
commands = Gotsha::Actions.constants.map do |command|
|
|
10
|
+
name = command.downcase
|
|
11
|
+
description = Kernel.const_get("Gotsha::Actions::#{command}::DESCRIPTION")
|
|
12
|
+
|
|
13
|
+
"#{name} # #{description}"
|
|
14
|
+
end.sort.join("\n")
|
|
8
15
|
|
|
9
16
|
"Available commands: \n\n#{commands}"
|
|
10
17
|
end
|
data/lib/gotsha/actions/init.rb
CHANGED
data/lib/gotsha/actions/show.rb
CHANGED
data/lib/gotsha/actions/test.rb
CHANGED
data/lib/gotsha/user_config.rb
CHANGED
|
@@ -3,18 +3,22 @@
|
|
|
3
3
|
module Gotsha
|
|
4
4
|
class UserConfig
|
|
5
5
|
def self.get(key)
|
|
6
|
-
config =
|
|
6
|
+
config = new.to_h
|
|
7
7
|
|
|
8
8
|
ENV["GOTSHA_#{key.to_s.upcase}"] || # this allows changing config via ENV vars
|
|
9
9
|
config[key]
|
|
10
|
-
rescue Errno::ENOENT
|
|
11
|
-
nil
|
|
12
10
|
end
|
|
13
11
|
|
|
14
12
|
def self.blank?
|
|
15
|
-
|
|
13
|
+
new.to_h.empty?
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def to_h
|
|
17
|
+
TomlRB.load_file(Config::CONFIG_FILE).transform_keys(&:to_sym)
|
|
16
18
|
rescue Errno::ENOENT
|
|
17
|
-
|
|
19
|
+
{}
|
|
20
|
+
rescue TomlRB::ParseError => e
|
|
21
|
+
raise Errors::HardFail, "Syntax error in config file\n\n#{e.message}"
|
|
18
22
|
end
|
|
19
23
|
end
|
|
20
24
|
end
|
data/lib/gotsha/version.rb
CHANGED
data/web/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<link rel="icon" href="favicon.ico" />
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<title>Gotsha — your local CI</title>
|
|
7
|
+
<title>Gotsha — your local testing CI</title>
|
|
8
8
|
<meta name="description" content="Gotsha — sign off your commits locally by running tests & linters and proving it in your PR." />
|
|
9
9
|
<style>
|
|
10
10
|
:root{
|
|
@@ -91,46 +91,52 @@
|
|
|
91
91
|
<!-- Checkmark integrated near 'SHA' -->
|
|
92
92
|
<path class="stroke" d="M660,120 l35,35 70,-80"/>
|
|
93
93
|
</svg>
|
|
94
|
-
<div class="title">Your local CI</div>
|
|
94
|
+
<div class="title">Your local testing CI</div>
|
|
95
95
|
</header>
|
|
96
96
|
|
|
97
97
|
<main>
|
|
98
98
|
<section class="hero" aria-labelledby="hero-title">
|
|
99
99
|
<h1 id="hero-title">Sign-off your commits locally — and let others see it.</h1>
|
|
100
|
-
<p>Run tests & linters on your machine, store results
|
|
100
|
+
<p>Run tests & linters on your machine, store complete results, and let your PR show your tests output and status. Quickly and automatically.</p>
|
|
101
101
|
<div class="actions">
|
|
102
|
-
<a class="btn primary" href="https://github.com/melounvitek/gotsha" target="_blank">
|
|
102
|
+
<a class="btn primary" href="https://github.com/melounvitek/gotsha" target="_blank">More details on Github</a>
|
|
103
103
|
<a class="btn secondary" href="https://github.com/melounvitek/gotsha/pull/35" target="_blank">Demo pull request</a>
|
|
104
104
|
</div>
|
|
105
105
|
</section>
|
|
106
106
|
|
|
107
|
-
<section class="
|
|
108
|
-
<
|
|
107
|
+
<section class="card" id="install" aria-labelledby="install-title">
|
|
108
|
+
<h2 id="install-title">Install</h3>
|
|
109
|
+
<p>Gotsha is distrubuted as a Ruby gem, so you need to
|
|
110
|
+
have <strong>Ruby</strong> working in your system. Apart from that, the only
|
|
111
|
+
other dependency is <strong>Git</strong>.</p>
|
|
112
|
+
<h3>Install gem</h3>
|
|
113
|
+
<pre><code># Install manually
|
|
114
|
+
gem install gotsha
|
|
115
|
+
|
|
116
|
+
# Or via your Gemfile
|
|
117
|
+
gem 'gotsha'
|
|
118
|
+
</code></pre>
|
|
119
|
+
<h3>Run <code>gotsha</code></h3>
|
|
120
|
+
<p>Then just run <code>gotsha</code> command and follow the prompts — Gotsha will guide you through the setup. It won't take more than 3 minutes!</p>
|
|
121
|
+
</section>
|
|
122
|
+
|
|
123
|
+
<section class="card">
|
|
124
|
+
<h2>How does it work?</h2>
|
|
125
|
+
<article>
|
|
109
126
|
<h3>1) Runs locally</h3>
|
|
110
127
|
<p>Gotsha runs the project test suite on your machine. This can happen automatically (for every Git commit or push), or manually; right before you ask for review. You can easily configure it whatever way suits your project best.</p>
|
|
111
128
|
</article>
|
|
112
|
-
<article
|
|
129
|
+
<article>
|
|
113
130
|
<h3>2) Stores test results for commit SHA</h3>
|
|
114
131
|
<p>Test results from every run are attached as <em>Git notes</em> for the recent commit SHA. (Got-SHA... you get it, right?)</p>
|
|
115
132
|
</article>
|
|
116
|
-
<article
|
|
133
|
+
<article>
|
|
117
134
|
<h3>3) Displays results in your GitHub PR</h3>
|
|
118
135
|
<p>Push as usual — the note follows your commit, and tiny Github Action instantly verifies it
|
|
119
136
|
and makes the tests result visible to reviewers. <a target="_blank" href="https://gotsha.org/failed_build.png">Check it out</a>; it even persist all the colors!</p>
|
|
120
137
|
</article>
|
|
121
138
|
</section>
|
|
122
139
|
|
|
123
|
-
<!--
|
|
124
|
-
<section class="card" id="install" aria-labelledby="install-title">
|
|
125
|
-
<h3 id="install-title">Install</h3>
|
|
126
|
-
<p>Install</p>
|
|
127
|
-
<pre><code># RubyGems
|
|
128
|
-
gem install gotsha
|
|
129
|
-
|
|
130
|
-
# Or add to your Gemfile
|
|
131
|
-
gem 'gotsha'</code></pre>
|
|
132
|
-
</section>
|
|
133
|
-
-->
|
|
134
140
|
|
|
135
141
|
<p class="foot">
|
|
136
142
|
© <span id="y"></span> <a target="_blank" href="https://x.com/melounvitek">Vítek Meloun</a> (<a target="_blank" href="mailto:vitek@meloun.info">vitek@meloun.info</a>)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gotsha
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.1
|
|
4
|
+
version: 0.1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vitek Meloun
|
|
@@ -86,5 +86,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
86
86
|
requirements: []
|
|
87
87
|
rubygems_version: 3.6.9
|
|
88
88
|
specification_version: 4
|
|
89
|
-
summary: 'Gotsha: your local CI'
|
|
89
|
+
summary: 'Gotsha: your local testing CI'
|
|
90
90
|
test_files: []
|