@@ -85,7 +85,9 @@ namespace :go do
8585 sh " which golangci-lint" do |ok , _ |
8686 raise " golangci-lint isn't installed. See. https://golangci-lint.run/welcome/install/" unless ok
8787 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 } "
8991 end
9092 end
9193end
@@ -101,12 +103,28 @@ jobs:
101103 - uses : actions/checkout@v4
102104 - uses : actions/setup-go@v5
103105 - 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
104117
105118 - name : export CGO_CFLAGS for golangci-lint
106119 run : bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
107120
121+ - name : export BUILD_TAG for golangci-lint
122+ run : echo "BUILD_TAG=$(bundle exec rake go:build_tag)" >> $GITHUB_ENV
123+
108124 - name : Run golangci-lint
109125 uses : golangci/golangci-lint-action@v6
126+ with :
127+ args : --build-tags ${{ env.BUILD_TAG }}
110128` ` `
111129
112130#### Available configurations
0 commit comments