@@ -85,7 +85,9 @@ namespace :go do
85
85
sh " which golangci-lint" do |ok , _ |
86
86
raise " golangci-lint isn't installed. See. https://golangci-lint.run/welcome/install/" unless ok
87
87
end
88
- sh GoGem ::RakeTask .build_env_vars, " golangci-lint run"
88
+
89
+ build_tag = GoGem ::Util .ruby_minor_version_build_tag
90
+ sh GoGem ::RakeTask .build_env_vars, " golangci-lint run --build-tags #{ build_tag } "
89
91
end
90
92
end
91
93
end
@@ -101,12 +103,28 @@ jobs:
101
103
- uses : actions/checkout@v4
102
104
- uses : actions/setup-go@v5
103
105
- uses : ruby/setup-ruby@v1
106
+ with :
107
+ bundler-cache : false
108
+
109
+ # FIXME: setup-go installs cache in `vendor/` and setup-ruby installs cache in `vendor/bundle/`
110
+ # If we use the cache in setup-go and setup-ruby at the same time, this doesn't work well because they use the same directory.
111
+ # Therefore, the installation location needs to be changed from the setup-ruby default.
112
+ - name : bundle install
113
+ run : |
114
+ set -xe
115
+ bundle config --local path ruby-vendor/bundle
116
+ bundle install --jobs 4
104
117
105
118
- name : export CGO_CFLAGS for golangci-lint
106
119
run : bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
107
120
121
+ - name : export BUILD_TAG for golangci-lint
122
+ run : echo "BUILD_TAG=$(bundle exec rake go:build_tag)" >> $GITHUB_ENV
123
+
108
124
- name : Run golangci-lint
109
125
uses : golangci/golangci-lint-action@v6
126
+ with :
127
+ args : --build-tags ${{ env.BUILD_TAG }}
110
128
` ` `
111
129
112
130
#### Available configurations
0 commit comments