gotsha 0.2.4 → 0.2.6
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/.gotsha/hooks/post-commit +2 -1
- data/.gotsha/hooks/pre-push +3 -17
- data/CHANGELOG.md +8 -0
- data/lib/gotsha/actions/fetch.rb +17 -0
- data/lib/gotsha/actions/push.rb +26 -0
- data/lib/gotsha/templates/git_hooks/post-commit +2 -1
- data/lib/gotsha/templates/git_hooks/pre-push +3 -17
- data/lib/gotsha/templates/github_action_example.yml +0 -1
- data/lib/gotsha/version.rb +1 -1
- data/lib/gotsha.rb +2 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19704a3e5086fd685b9adc78b8c16463584c6f67e3864549ebffbbe1bfb95449
|
4
|
+
data.tar.gz: 388cfa9549babd3c6c86c720ba7862e7c566cc47aae5415b3af127032682d2e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a53d8d59c6395bb7f987fffcd647a54ebb292c106103a171a11cdea4f103bcba71a5fa24e5e341666a3aa54dc93d2473f809532bde1c8cc4bcbf135beeb4105
|
7
|
+
data.tar.gz: 0c06aa8cd525bd415483b33b9b4b225717a76d2aa5883b7f3aac81ef0e8a41a10ba0df7852ce5284336f1c6046a3e5a96be62286f860929ac39cbb0e522043d2
|
data/.gotsha/hooks/post-commit
CHANGED
data/.gotsha/hooks/pre-push
CHANGED
@@ -1,21 +1,7 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
set -euo pipefail
|
3
3
|
|
4
|
-
|
4
|
+
grep -qE 'pre_push_tests\s*=\s*true' .gotsha/config.toml || exit 0
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
push_gotsha_notes() {
|
9
|
-
# if already done before, let's only push the notes and exit
|
10
|
-
git push --no-verify origin refs/notes/gotsha:refs/notes/gotsha && return 0
|
11
|
-
|
12
|
-
# if pushing above failed, it means we need to do some one-time Git setup
|
13
|
-
git fetch origin 'refs/notes/gotsha:refs/notes/gotsha-remote'
|
14
|
-
git notes --ref=gotsha merge -v refs/notes/gotsha-remote
|
15
|
-
git update-ref -d refs/notes/gotsha-remote
|
16
|
-
|
17
|
-
# ... and push again!
|
18
|
-
git push --no-verify origin refs/notes/gotsha:refs/notes/gotsha
|
19
|
-
}
|
20
|
-
|
21
|
-
push_gotsha_notes
|
6
|
+
exe/gotsha status || exe/gotsha test
|
7
|
+
exe/gotsha push
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [0.2.6] - 2025-10-14
|
2
|
+
|
3
|
+
- Make the GH action faster by avoiding `bundle install` (we need to install just the Gotsha gem)
|
4
|
+
|
5
|
+
## [0.2.5] - 2025-10-14
|
6
|
+
|
7
|
+
- Introduce `push` and `fetch` commands
|
8
|
+
|
1
9
|
## [0.2.4] - 2025-10-14
|
2
10
|
|
3
11
|
- Change Github Action config to actually use the gem itself (instead of bash scripting the logic)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gotsha
|
4
|
+
module Actions
|
5
|
+
class Fetch
|
6
|
+
DESCRIPTION = "fetches Gotsha test results from remote"
|
7
|
+
|
8
|
+
def call
|
9
|
+
command = BashCommand.silent_run!("git fetch origin 'refs/notes/gotsha:refs/notes/gotsha'")
|
10
|
+
|
11
|
+
raise(Errors::HardFail, "something went wrong") unless command.success?
|
12
|
+
|
13
|
+
"fetched"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gotsha
|
4
|
+
module Actions
|
5
|
+
class Push
|
6
|
+
DESCRIPTION = "pushes Gotsha test results to remote"
|
7
|
+
|
8
|
+
def call
|
9
|
+
try_push = push_command
|
10
|
+
|
11
|
+
unless try_push.success?
|
12
|
+
Fetch.new.call
|
13
|
+
push_command
|
14
|
+
end
|
15
|
+
|
16
|
+
"pushed"
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def push_command
|
22
|
+
BashCommand.silent_run!("git push --no-verify origin refs/notes/gotsha:refs/notes/gotsha")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,21 +1,7 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
set -euo pipefail
|
3
3
|
|
4
|
-
|
4
|
+
grep -qE 'pre_push_tests\s*=\s*true' .gotsha/config.toml || exit 0
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
push_gotsha_notes() {
|
9
|
-
# if already done before, let's only push the notes and exit
|
10
|
-
git push --no-verify origin refs/notes/gotsha:refs/notes/gotsha && return 0
|
11
|
-
|
12
|
-
# if pushing above failed, it means we need to do some one-time Git setup
|
13
|
-
git fetch origin 'refs/notes/gotsha:refs/notes/gotsha-remote'
|
14
|
-
git notes --ref=gotsha merge -v refs/notes/gotsha-remote
|
15
|
-
git update-ref -d refs/notes/gotsha-remote
|
16
|
-
|
17
|
-
# ... and push again!
|
18
|
-
git push --no-verify origin refs/notes/gotsha:refs/notes/gotsha
|
19
|
-
}
|
20
|
-
|
21
|
-
push_gotsha_notes
|
6
|
+
gotsha status || gotsha test
|
7
|
+
gotsha push
|
data/lib/gotsha/version.rb
CHANGED
data/lib/gotsha.rb
CHANGED
@@ -6,8 +6,10 @@ require "toml-rb"
|
|
6
6
|
require_relative "gotsha/action_dispatcher"
|
7
7
|
require_relative "gotsha/actions/commit"
|
8
8
|
require_relative "gotsha/actions/configure"
|
9
|
+
require_relative "gotsha/actions/fetch"
|
9
10
|
require_relative "gotsha/actions/help"
|
10
11
|
require_relative "gotsha/actions/init"
|
12
|
+
require_relative "gotsha/actions/push"
|
11
13
|
require_relative "gotsha/actions/show"
|
12
14
|
require_relative "gotsha/actions/test"
|
13
15
|
require_relative "gotsha/actions/uninstall"
|
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.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitek Meloun
|
@@ -45,8 +45,10 @@ files:
|
|
45
45
|
- lib/gotsha/action_dispatcher.rb
|
46
46
|
- lib/gotsha/actions/commit.rb
|
47
47
|
- lib/gotsha/actions/configure.rb
|
48
|
+
- lib/gotsha/actions/fetch.rb
|
48
49
|
- lib/gotsha/actions/help.rb
|
49
50
|
- lib/gotsha/actions/init.rb
|
51
|
+
- lib/gotsha/actions/push.rb
|
50
52
|
- lib/gotsha/actions/show.rb
|
51
53
|
- lib/gotsha/actions/status.rb
|
52
54
|
- lib/gotsha/actions/test.rb
|