Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial GHA workflows #48

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Ruby!
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"

- name: run tests
run: rake test
9 changes: 9 additions & 0 deletions rakelib/test.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'rake/testtask'

Rake::TestTask.new do |t|
t.libs << "tests"
t.test_files = FileList["tests/**/*_test.rb"]
t.verbose = true
end
desc 'Run tests'

26 changes: 26 additions & 0 deletions tests/check_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require_relative "test_helper"

class CheckTest < Minitest::Test
def with_captured_stdout
original_stdout = $stdout
$stdout = StringIO.new
yield
$stdout.string
ensure
$stdout = original_stdout
end

def test_check_asserts
output = with_captured_stdout do
Rake::Task['check:asserts'].invoke
end
assert_match(/OK/, output)
end

def test_check_abouts
output = with_captured_stdout do
Rake::Task['check:abouts'].invoke
end
assert_match(/OK/, output)
end
end
4 changes: 4 additions & 0 deletions tests/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require "minitest/autorun"
require "rake"

Rake.application.load_rakefile