Skip to content

Commit 0a2c3b3

Browse files
authored
Merge pull request #270 from ruby-go-gem/feature/use-bundler-cache
ci: Use bundler-cache in setup-ruby
2 parents 56acc2c + 69f6793 commit 0a2c3b3

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,7 @@ jobs:
123123
- uses: ruby/setup-ruby@v1
124124
with:
125125
ruby-version: ${{ matrix.ruby }}
126-
bundler-cache: false
127-
128-
# FIXME: setup-go installs cache in `vendor/` and setup-ruby installs cache in `vendor/bundle/`
129-
# 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.
130-
# Therefore, the installation location needs to be changed from the setup-ruby default.
131-
- name: bundle install
132-
run: |
133-
set -xe
134-
bundle config --local path ruby-vendor/bundle
135-
bundle install --jobs 4
126+
bundler-cache: true
136127

137128
- name: export CGO_CFLAGS for golangci-lint
138129
run: bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
@@ -148,7 +139,7 @@ jobs:
148139
uses: golangci/golangci-lint-action@v6
149140
with:
150141
version: ${{ env.GOLANGCI_LINT_VERSION }}
151-
args: --build-tags ${{ env.BUILD_TAG }}
142+
args: --build-tags ${{ env.BUILD_TAG }} --modules-download-mode=readonly
152143

153144
- name: Slack Notification (not success)
154145
uses: act10ns/slack@v2

_gem/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace :go do
8787
end
8888

8989
build_tag = GoGem::Util.ruby_minor_version_build_tag
90-
sh GoGem::RakeTask.build_env_vars, "golangci-lint run --build-tags #{build_tag}"
90+
sh GoGem::RakeTask.build_env_vars, "golangci-lint run --build-tags #{build_tag} --modules-download-mode=readonly"
9191
end
9292
end
9393
end

_tasks/go.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace :go do
1414
end
1515

1616
build_tag = GoGem::Util.ruby_minor_version_build_tag
17-
sh GoGem::RakeTask.build_env_vars, "golangci-lint run --build-tags #{build_tag}"
17+
sh GoGem::RakeTask.build_env_vars, "golangci-lint run --build-tags #{build_tag} --modules-download-mode=readonly"
1818
end
1919
end
2020

0 commit comments

Comments
 (0)