Skip to content

Commit 1e176cb

Browse files
committed
CI: Build gem for each PR
Validates that the gemspec is correct and the gem can be build.
1 parent 0ce65c0 commit 1e176cb

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/tests.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ jobs:
6363
bundler-cache: true
6464
- name: Output Ruby Environment
6565
run: bundle env
66-
66+
- name: Build gem for all platforms
67+
run: bundle exec rake pl_ci:gem_build
68+
# Windows tests fail if the gem is in the filesystem
69+
- name: Cleanup builds
70+
if: runner.os == 'Windows'
71+
run: Remove-Item -Path *.gem
6772
- name: Run tests on Windows
6873
if: runner.os == 'Windows'
6974
run: |

Rakefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ namespace :pl_ci do
6161
task :gem_build, [:gemspec] do |t, args|
6262
args.with_defaults(gemspec: 'openvox.gemspec')
6363
stdout, stderr, status = Open3.capture3(<<~END)
64-
gem build #{args.gemspec} --platform x86-mingw32 && \
65-
gem build #{args.gemspec} --platform x64-mingw32 && \
66-
gem build #{args.gemspec} --platform universal-darwin && \
67-
gem build #{args.gemspec}
64+
gem build #{args.gemspec} --verbose --strict --platform x86-mingw32 && \
65+
gem build #{args.gemspec} --verbose --strict --platform x64-mingw32 && \
66+
gem build #{args.gemspec} --verbose --strict --platform universal-darwin && \
67+
gem build #{args.gemspec} --verbose --strict
6868
END
6969
if !status.exitstatus.zero?
7070
puts "Error building #{args.gemspec}\n#{stdout} \n#{stderr}"

0 commit comments

Comments
 (0)