Skip to content

Commit 9789fc8

Browse files
authored
Configure GitHub Actions (#96)
* Create ci.yml * Remove actions/cache * Drop Ruby 2.4, 2.5 from TravisCI Since CI is running on GitHub Workflows * Remove `apt-get update` * remove bundle install path * Remove codeclimate-test-reporter from travis.yml * it's not RSpec * Create coverage.yml * Add gemfile matrix * Remove name from coverage workflow * Delete .travis.yml * Add freeze for constant * Support Jekyll 4.0 * CI against Jekyll v4.0 * Add rubocop workflow * Add gem install bundler * Exclude Ruby 2.4 x Jekyll 4 ``` Bundler found conflicting requirements for the RubyGems version: In jekyll_4.0.gemfile: RubyGems (= 2.6.14.4) jekyll (= 4.0) was resolved to 4.0.0, which depends on RubyGems (>= 2.7.0) ``` * Remove debug option
1 parent c4bf041 commit 9789fc8

File tree

7 files changed

+81
-23
lines changed

7 files changed

+81
-23
lines changed

.github/workflows/ci.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
build:
5+
strategy:
6+
matrix:
7+
ruby: [2.4, 2.5, 2.6, 2.7]
8+
gemfile:
9+
- gemfiles/jekyll_4.0.gemfile
10+
- gemfiles/jekyll_3.8.gemfile
11+
- gemfiles/jekyll_3.7.gemfile
12+
- gemfiles/jekyll_3.6.gemfile
13+
exclude:
14+
- ruby: 2.4
15+
gemfile: gemfiles/jekyll_4.0.gemfile
16+
env:
17+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Ruby ${{ matrix.ruby }}
22+
uses: eregon/use-ruby-action@master
23+
with:
24+
ruby-version: ${{ matrix.ruby }}
25+
- name: bundle install
26+
run: |
27+
gem install bundler
28+
bundle install --jobs 4 --retry 3
29+
- name: Run Test
30+
run: bundle exec rake

.github/workflows/coverage.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Coverage
2+
on: [push]
3+
jobs:
4+
build:
5+
strategy:
6+
matrix:
7+
ruby: [2.6]
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Ruby ${{ matrix.ruby }}
12+
uses: eregon/use-ruby-action@master
13+
with:
14+
ruby-version: ${{ matrix.ruby }}
15+
- name: bundle install
16+
run: bundle install --jobs 4 --retry 3
17+
- uses: paambaati/[email protected]
18+
env:
19+
CC_TEST_REPORTER_ID: 6b81e393ea6ad38560386f650ea2fb0e57a7beb5e20f8c8364fabee30d5bff07
20+
with:
21+
coverageCommand: bundle exec rake

.github/workflows/rubocop.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: RuboCop
2+
on: [push]
3+
jobs:
4+
build:
5+
strategy:
6+
matrix:
7+
ruby: [2.6]
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Ruby ${{ matrix.ruby }}
12+
uses: eregon/use-ruby-action@master
13+
with:
14+
ruby-version: ${{ matrix.ruby }}
15+
- name: bundle install
16+
run: bundle install --jobs 4 --retry 3
17+
- name: Run RuboCop
18+
run: bundle exec rubocop

.travis.yml

-22
This file was deleted.

Appraisals

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# frozen_string_literal: true
22

3+
appraise 'jekyll-4.0' do
4+
gem 'jekyll', '4.0'
5+
end
6+
37
appraise 'jekyll-3.8' do
48
gem 'jekyll', '3.8'
59
end

gemfiles/jekyll_4.0.gemfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "jekyll", "4.0"
6+
7+
gemspec path: "../"

lib/table_of_contents/parser.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Jekyll
44
module TableOfContents
55
# Parse html contents and generate table of contents
66
class Parser
7-
PUNCTUATION_REGEXP = /[^\p{Word}\- ]/u
7+
PUNCTUATION_REGEXP = /[^\p{Word}\- ]/u.freeze
88

99
def initialize(html, options = {})
1010
@doc = Nokogiri::HTML::DocumentFragment.parse(html)

0 commit comments

Comments
 (0)