Skip to content

Commit 71c5181

Browse files
authored
Merge pull request #216 from bastelfreak/build
CI: Build gem for each PR & Move packaging checks to global config & Windows: Run one spec file per CPU core
2 parents 0ce65c0 + 4864dee commit 71c5181

File tree

3 files changed

+34
-40
lines changed

3 files changed

+34
-40
lines changed

.github/workflows/checks.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/tests.yaml

Lines changed: 30 additions & 2 deletions
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: |
@@ -85,7 +90,7 @@ jobs:
8590
ruby -ropenssl -e 'puts "OpenSSL Version - #{OpenSSL::OPENSSL_VERSION}"; puts "OpenSSL Library Version - #{OpenSSL::OPENSSL_LIBRARY_VERSION}"'
8691
8792
# Run tests
88-
bundle exec rake parallel:spec[2]
93+
bundle exec rake parallel:spec
8994
9095
- name: Run tests on Linux
9196
if: runner.os == 'Linux'
@@ -102,11 +107,34 @@ jobs:
102107
103108
bundle exec rake parallel:spec
104109
110+
rake_checks:
111+
name: AIO Package Rake Checks
112+
runs-on: ubuntu-24.04
113+
steps:
114+
# needs fetch-depth because the packaging dem reads old git tags
115+
- name: Checkout current PR
116+
uses: actions/checkout@v5
117+
with:
118+
fetch-depth: 0
119+
- name: Install Ruby version 3.3
120+
uses: ruby/setup-ruby@v1
121+
with:
122+
ruby-version: 3.3
123+
bundler-cache: true
124+
- name: Validate code
125+
run: |
126+
bundle exec rake rubocop
127+
bundle exec rake -T | grep vox:build
128+
bundle exec rake -T | grep vox:promote
129+
bundle exec rake -T | grep vox:upload
130+
working-directory: packaging
131+
105132
tests:
106133
if: always()
107134
needs:
108135
- checks
109136
- rspec_tests
137+
- rake_checks
110138
runs-on: ubuntu-24.04
111139
name: Test suite
112140
steps:

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)