Skip to content

Setup GitHub Action CI workflow #28

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Test
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
schedule:
- cron: 13 7 * * 6
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version:
- 3.3.8
- 3.4.3
crystal_version:
- 1.15.1
- latest
experimental: [false]
include:
- ruby_version: head
crystal_version: nightly
experimental: true
- ruby_version: head
crystal_version: 1.16.0
experimental: true
name: Ruby ${{ matrix.ruby_version }} / Crystal ${{ matrix.crystal_version }}
continue-on-error: ${{ matrix.experimental }}
steps:
- name: "[Git] Checkout code"
uses: actions/checkout@v4

- uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal_version }}

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true

- name: "[Test] Run tests"
run: |
bundle exec crystalruby clean
bundle exec rake test
env:
CRYSTAL_RUBY_SINGLE_THREAD_MODE: true

- name: "[Test] Validate examples"
run: |
for example in examples/**/*.rb; do
echo " > Processing $example..."
bundle exec ruby $example
done
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ source "https://rubygems.org"
# Specify your gem's dependencies in crystalruby.gemspec
gemspec

gem 'ffi'
gem "rake", "~> 13.0"
gem "ostruct" # It is used in rake gem

gem "minitest", "~> 5.16"
gem "minitest-reporters", "~> 1.4"
gem "benchmark"

gem "rubocop", "~> 1.21"
gem "debug", ">= 1.1.0"
gem "fiddle" # It is used in reline -> irb -> debug gem
9 changes: 8 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,38 @@ PATH
digest
ffi
fileutils (~> 1.7)
logger
prism (>= 1.3.0, < 1.5.0)

GEM
remote: https://rubygems.org/
specs:
ansi (1.5.0)
ast (2.4.2)
benchmark (0.4.0)
builder (3.3.0)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
digest (3.1.1)
ffi (1.17.0)
ffi (1.17.0-arm64-darwin)
fiddle (1.1.8)
fileutils (1.7.2)
io-console (0.7.2)
irb (1.12.0)
rdoc
reline (>= 0.4.2)
json (2.7.1)
language_server-protocol (3.17.0.3)
logger (1.7.0)
minitest (5.22.3)
minitest-reporters (1.7.1)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
ostruct (0.6.1)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
Expand Down Expand Up @@ -70,11 +75,13 @@ PLATFORMS
ruby

DEPENDENCIES
benchmark
crystalruby!
debug (>= 1.1.0)
ffi
fiddle
minitest (~> 5.16)
minitest-reporters (~> 1.4)
ostruct
rake (~> 13.0)
rubocop (~> 1.21)

Expand Down
1 change: 1 addition & 0 deletions crystalruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "ffi"
spec.add_dependency "fileutils", "~> 1.7"
spec.add_dependency "prism", ">= 1.3.0", "< 1.5.0"
spec.add_dependency "logger"
# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
end
4 changes: 2 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
Minitest.parallel_executor = Struct.new(:shutdown).new(nil)

CrystalRuby.configure do |config|
config.verbose = false
config.log_level = :warn
config.verbose = true
config.log_level = :debug
config.colorize_log_output = true
config.debug = true
config.single_thread_mode = !!ENV["CRYSTAL_RUBY_SINGLE_THREAD_MODE"]
Expand Down