File tree Expand file tree Collapse file tree 5 files changed +20
-4
lines changed Expand file tree Collapse file tree 5 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,16 @@ jobs:
136
136
137
137
- run : echo $CGO_CFLAGS
138
138
139
+ - name : export BUILD_TAG for golangci-lint
140
+ run : echo "BUILD_TAG=$(bundle exec rake go:build_tag)" >> $GITHUB_ENV
141
+
142
+ - run : echo $BUILD_TAG
143
+
139
144
- name : golangci-lint
140
145
uses : golangci/golangci-lint-action@v6
141
146
with :
142
147
version : v1.60
148
+ args : --build-tags ${{ env.BUILD_TAG }}
143
149
144
150
- name : Slack Notification (not success)
145
151
uses : act10ns/slack@v2
Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ Metrics/BlockLength:
42
42
- " **/*_spec.rb"
43
43
44
44
Metrics/ClassLength :
45
- Max : 112
46
-
47
45
Exclude :
48
46
- " **/*_test.rb"
49
47
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ module GoGem
42
42
# end
43
43
# end
44
44
# end
45
- class RakeTask < ::Rake ::TaskLib
45
+ class RakeTask < ::Rake ::TaskLib # rubocop:disable Metrics/ClassLength
46
46
DEFAULT_TASK_NAMESPACE = :go
47
47
48
48
DEFAULT_GO_BIN_PATH = "go"
@@ -89,6 +89,7 @@ def initialize(gem_name)
89
89
define_go_testrace_task
90
90
define_go_fmt_task
91
91
define_go_build_envs_task
92
+ define_go_build_tag_task
92
93
end
93
94
end
94
95
@@ -205,5 +206,12 @@ def define_go_build_envs_task
205
206
end
206
207
end
207
208
end
209
+
210
+ def define_go_build_tag_task
211
+ desc "Print build tag"
212
+ task ( :build_tag ) do
213
+ puts GoGem ::Util . ruby_minor_version_build_tag
214
+ end
215
+ end
208
216
end
209
217
end
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ module GoGem
46
46
47
47
def define_go_build_envs_task : () -> void
48
48
49
+ def define_go_build_tag_task : () -> void
50
+
49
51
def within_target_dir : () { () -> void } -> void
50
52
51
53
def ext_dir : () -> String
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ namespace :go do
12
12
sh "which golangci-lint" do |ok , _ |
13
13
raise "golangci-lint isn't installed. See. https://golangci-lint.run/welcome/install/" unless ok
14
14
end
15
- sh GoGem ::RakeTask . build_env_vars , "golangci-lint run"
15
+
16
+ build_tag = GoGem ::Util . ruby_minor_version_build_tag
17
+ sh GoGem ::RakeTask . build_env_vars , "golangci-lint run --build-tags #{ build_tag } "
16
18
end
17
19
end
18
20
You can’t perform that action at this time.
0 commit comments