Skip to content

Commit eedd54a

Browse files
committed
Enable testing using Github Actions
This commit changes the Rakefile to use the minitest rakefile methods to run all of the tests. This is done because the existing `bin/testunit` calls directly to `sh` which is not present on Windows platforms. By making this a ruby/rake call it makes the test suite platform independent. The existing files in `bin` are left in case there is other existing infrastructure that uses them. This commit also adds a Github Action yaml file that tests this code against the latest versions of windows, ubuntu, and macos. This validates that the test runner change works on all of the existing supported platforms as well as Windows.
1 parent d0411f2 commit eedd54a

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
type: [opened, reopened, edited]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
os: [ubuntu, macos, windows]
14+
ruby: [2.5]
15+
runs-on: ${{ matrix.os }}-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: ruby/setup-ruby@v1
19+
with:
20+
ruby-version: ${{ matrix.ruby }}
21+
- run: bundle install
22+
- run: bundle exec rake

Rakefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ Rake::ExtensionTask.new do |ext|
1010
ext.gem_spec = gemspec
1111
end
1212

13-
task :test do
14-
sh 'bin/testunit'
13+
# task :test do
14+
# sh 'bin/testunit'
15+
# end
16+
17+
require "rake/testtask"
18+
19+
Rake::TestTask.new(:test) do |t|
20+
t.libs << "test"
21+
t.libs << "lib"
22+
t.test_files = FileList["test/**/*_test.rb"]
1523
end
1624

25+
1726
task(default: %i(compile test))

0 commit comments

Comments
 (0)