Skip to content

Commit 15b44d5

Browse files
committed
Replace Travis CI w/ GitHub Actions CI
There are a few things that had to happen: - Had to add more modern rubies to the CI configuration. - Had to tweak versions to use the latest patch levels and bump jruby GitHub Actions doesn't have some of the versions that we were using in Travis CI. - Update README to point to GitHub Actions instead of Travis CI
1 parent 8f48ef1 commit 15b44d5

File tree

4 files changed

+32
-31
lines changed

4 files changed

+32
-31
lines changed

.github/workflows/benchmarks.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
rake:
11+
runs-on: ubuntu-latest
12+
env:
13+
SHARE: "1"
14+
15+
strategy:
16+
matrix:
17+
ruby-version: ['3.1', '3.0', '2.7', '2.5.1', '2.4.3', '2.3.0',
18+
'2.1.9', '2.2.10', 'ruby-head', 'jruby-9.1.17.0',
19+
'jruby-head']
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Ruby ${{ matrix.ruby-version }}
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: ${{ matrix.ruby-version }}
27+
- name: Install dependencies
28+
run: bundle install
29+
- name: Run benchmarks
30+
run: bundle exec rake

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Fast Ruby [![Build Status](https://travis-ci.org/JuanitoFatas/fast-ruby.svg?branch=travis)](https://travis-ci.org/JuanitoFatas/fast-ruby)
1+
Fast Ruby [![Benchmarks](https://github.com/fastruby/fast-ruby/actions/workflows/benchmarks.yml/badge.svg)](https://github.com/fastruby/fast-ruby/actions/workflows/benchmarks.yml)
22
=======================================================================================================================================================================
33

44
In [Erik Michaels-Ober](https://github.com/sferik)'s great talk, 'Writing Fast Ruby': [Video @ Baruco 2014](https://www.youtube.com/watch?v=fGFM_UrSp70), [Slide](https://speakerdeck.com/sferik/writing-fast-ruby), he presented us with many idioms that lead to faster running Ruby code. He inspired me to document these to let more people know. I try to link to real commits so people can see that this can really have benefits in the real world. **This does not mean you can always blindly replace one with another. It depends on the context (e.g. `gsub` versus `tr`). Friendly reminder: Use with caution!**
@@ -7,7 +7,7 @@ Each idiom has a corresponding code example that resides in [code](code).
77

88
All results listed in README.md are running with Ruby 2.2.0p0 on OS X 10.10.1. Machine information: MacBook Pro (Retina, 15-inch, Mid 2014), 2.5 GHz Intel Core i7, 16 GB 1600 MHz DDR3. Your results may vary, but you get the idea. : )
99

10-
You can checkout [the travis build](https://travis-ci.org/JuanitoFatas/fast-ruby) for these benchmark results ran against different Ruby implementations.
10+
You can checkout [the GitHub Actions build](https://github.com/fastruby/fast-ruby/actions) for these benchmark results ran against different Ruby implementations.
1111

1212
**Let's write faster code, together! <3**
1313

Rakefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
desc "run benchmark in current ruby"
22
task :run_benchmark do
3-
ENV['SHARE'] = ENV['GITHUB_ACTIONS'] # only share to http://ips.fastruby.io when running within GitHub Actions env
4-
53
Dir["code/general/*.rb"].each do |benchmark|
64
puts "$ ruby -v #{benchmark}"
75
system("ruby", "-v", "-W0", benchmark)

0 commit comments

Comments
 (0)