Skip to content

Commit 70d9e41

Browse files
committed
Use rake go:build_envs in CI
1 parent e993bcb commit 70d9e41

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,19 @@ jobs:
9999
- uses: ruby/setup-ruby@v1
100100
with:
101101
ruby-version: ruby
102+
bundler-cache: false
102103

103-
- name: export CGO_CFLAGS
104-
run: ruby -e "puts %Q(CGO_CFLAGS=-I#{RbConfig::CONFIG['rubyarchhdrdir']} -I#{RbConfig::CONFIG['rubyhdrdir']})" >> $GITHUB_ENV
104+
# FIXME: setup-go installs cache in `vendor/` and setup-ruby installs cache in `vendor/bundle/`
105+
# 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.
106+
# Therefore, the installation location needs to be changed from the setup-ruby default.
107+
- name: bundle install
108+
run: |
109+
set -xe
110+
bundle config --local path ruby-vendor/bundle
111+
bundle install --jobs 4
112+
113+
- name: export CGO_CFLAGS for golangci-lint
114+
run: bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
105115

106116
- run: echo $CGO_CFLAGS
107117

0 commit comments

Comments
 (0)