Skip to content

Commit 698a8d8

Browse files
committed
Switch from Travis CI to GitHub CI
It seems Travis CI is no longer available for pull requests and forks to run tests. In order for this to work by default and give feedback early, try GitHub CI instead. Remove Ruby 2.3 and 2.4 from the matrix, because are no longer supported: ``` kramdown was resolved to 2.5.1, which depends on Ruby (>= 2.5) Current Ruby version: Ruby (= 2.4.10) ``` Fix failure in profiler job: ``` …/gems/memory_profiler-1.1.0/lib/memory_profiler/results.rb:141: in `pretty_print': private method `puts' called for {:scale_bytes=>true}:Hash (NoMethodError) io.puts "Total allocated: #{total_allocated_output} (#{total_allocated} objects)" ^^^^^ from /home/runner/work/kramdown/kramdown/benchmark/memory_profiler_preload.rb:33 ```
1 parent fc051a9 commit 698a8d8

File tree

3 files changed

+75
-40
lines changed

3 files changed

+75
-40
lines changed

.github/workflows/CI.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
on:
3+
push:
4+
5+
jobs:
6+
lint:
7+
name: Rubocop
8+
runs-on: ubuntu-latest
9+
steps:
10+
11+
- uses: actions/checkout@v4
12+
13+
- name: Install Rubocop
14+
run: |
15+
sudo gem install rubocop -v '~> 1.70'
16+
sudo gem install rubocop-performance -v '~> 1.23'
17+
18+
- name: Run Rubocop
19+
run: rubocop --fail-level error
20+
21+
test:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- ruby: '2.5'
27+
- ruby: '2.6'
28+
- ruby: '2.7'
29+
- ruby: '3.0'
30+
- ruby: '3.1'
31+
- ruby: '3.2'
32+
- ruby: jruby-head
33+
experimental: true
34+
- name: Profile Memory Usage
35+
ruby: '3.2'
36+
profile_memory: true
37+
38+
name: ${{ matrix.name || format('Ruby {0}', matrix.ruby) }}
39+
continue-on-error: ${{ matrix.experimental == true }}
40+
runs-on: ubuntu-24.04
41+
steps:
42+
43+
- uses: actions/checkout@v4
44+
45+
# https://github.com/ruby/setup-ruby
46+
- uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: ${{ matrix.ruby }}
49+
50+
- name: Install packages
51+
run: |
52+
ruby --version
53+
gem --version
54+
sudo apt-get install -q -y texlive-latex-base texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra
55+
wget https://github.com/htacg/tidy-html5/releases/download/5.4.0/tidy-5.4.0-64bit.deb
56+
sudo apt purge libtidy-0.99-0
57+
sudo dpkg -i tidy-5.4.0-64bit.deb
58+
gem install rake
59+
60+
- name: Install dependencies
61+
run: |
62+
rake gemspec
63+
echo -e 'source "http://www.rubygems.org"\n\ngemspec' > Gemfile
64+
bundle install
65+
66+
- name: Run tests
67+
if: ${{ !matrix.profile_memory }}
68+
run: ruby -Ilib:test test/test_*
69+
70+
- name: Run profile_memory
71+
if: ${{ matrix.profile_memory }}
72+
run: |
73+
gem install memory_profiler -v '~> 1.0'
74+
rake dev:profile_memory

.travis.yml

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

benchmark/memory_profiler_preload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
print_opts.merge!(to_file: report_file)
3131
puts "\nDetailed report saved to '#{report_file}'"
3232
end
33-
report.pretty_print(print_opts)
33+
report.pretty_print(**print_opts)
3434
}

0 commit comments

Comments
 (0)