Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b3fb5fa87 | |||
| 5f7c17b900 | |||
| 9ade6d983e | |||
| f464b6dc11 | |||
| 8c811d5638 | |||
| 4229164197 | |||
| b6a063152f |
+27
-10
@@ -1,29 +1,46 @@
|
|||||||
name: Ruby Build
|
name: Ruby Build
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
jruby_build:
|
||||||
|
name: JRuby (${{ matrix.ruby }})
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ruby: [2.4.0, 2.6.0, 3.0.0, jruby-9.2.18.0]
|
ruby: [jruby-9.2.18]
|
||||||
steps:
|
steps:
|
||||||
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
|
|
||||||
- run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!"
|
|
||||||
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
|
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
|
|
||||||
- run: echo "The workflow is now ready to test your code on the runner."
|
|
||||||
- name: List files in the repository
|
- name: List files in the repository
|
||||||
run: |
|
run: |
|
||||||
ls ${{ github.workspace }}
|
ls ${{ github.workspace }}
|
||||||
- uses: actions/setup-java@v2
|
- name: Set up Java
|
||||||
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
- uses: ruby/setup-ruby@v1
|
- name: Set up Ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
- name: exec rake
|
- name: Run tests
|
||||||
|
run: bundle exec rake
|
||||||
|
mri_build:
|
||||||
|
name: Ruby (${{ matrix.ruby }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ruby: [2.6, 2.7, 3.0]
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: List files in the repository
|
||||||
|
run: |
|
||||||
|
ls ${{ github.workspace }}
|
||||||
|
- name: Set up Ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: ${{ matrix.ruby }}
|
||||||
|
bundler-cache: true
|
||||||
|
- name: Run tests
|
||||||
run: bundle exec rake
|
run: bundle exec rake
|
||||||
|
|||||||
@@ -1,8 +1,25 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
if RUBY_PLATFORM == 'java'
|
gem 'warbler', platforms: :jruby
|
||||||
gem 'warbler'
|
|
||||||
end
|
# FIXME:
|
||||||
|
#
|
||||||
|
# There's an issue in 1.12.5 that causes XHTML elements to be generated badly,
|
||||||
|
# causing Gollum's test suite to fail.[1] The issue has been fixed upstream,
|
||||||
|
# but we're still waiting for a new Nokogiri point release.
|
||||||
|
#
|
||||||
|
# However, 1.12.5 is a security patch, so we don't want end users to use an
|
||||||
|
# older version of Nokogiri. But this is safe to do in our CI environment.
|
||||||
|
#
|
||||||
|
# Once there's a new Nokogiri release, we can remove this dependency and JRuby
|
||||||
|
# CI should pass normally again.
|
||||||
|
#
|
||||||
|
# Note that Nokogiri 1.11+ does not support Ruby v2.4.x anymore. So to make our
|
||||||
|
# current CI workflows pass, we should only try to install this version of
|
||||||
|
# Nokogiri for newer Ruby versions.
|
||||||
|
#
|
||||||
|
# [1]: https://github.com/gollum/gollum/issues/1779
|
||||||
|
gem 'nokogiri', '1.12.4' unless RUBY_VERSION.include? '2.4'
|
||||||
|
|
||||||
gemspec
|
gemspec
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ Gem::Specification.new do |s|
|
|||||||
s.add_development_dependency 'rack-test', '~> 0.6.3'
|
s.add_development_dependency 'rack-test', '~> 0.6.3'
|
||||||
s.add_development_dependency 'shoulda', '~> 3.6.0'
|
s.add_development_dependency 'shoulda', '~> 3.6.0'
|
||||||
s.add_development_dependency 'minitest-reporters', '~> 1.3.6'
|
s.add_development_dependency 'minitest-reporters', '~> 1.3.6'
|
||||||
s.add_development_dependency 'twitter_cldr', '~> 3.2.0'
|
|
||||||
s.add_development_dependency 'mocha', '~> 1.8.0'
|
s.add_development_dependency 'mocha', '~> 1.8.0'
|
||||||
s.add_development_dependency 'test-unit', '~> 3.3.0'
|
s.add_development_dependency 'test-unit', '~> 3.3.0'
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ require 'mocha/setup'
|
|||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'minitest/reporters'
|
require 'minitest/reporters'
|
||||||
require 'minitest/spec'
|
require 'minitest/spec'
|
||||||
require 'twitter_cldr'
|
|
||||||
require 'tmpdir'
|
require 'tmpdir'
|
||||||
|
|
||||||
# Silence locale validation warning
|
# Silence locale validation warning
|
||||||
|
|||||||
+12
-14
@@ -39,29 +39,27 @@ context "Frontend" do
|
|||||||
assert_match /<pre><code>one\ntwo\nthree\nfour\n<\/code><\/pre>\n/m, last_response.body
|
assert_match /<pre><code>one\ntwo\nthree\nfour\n<\/code><\/pre>\n/m, last_response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
def nfd utf8
|
|
||||||
TwitterCldr::Normalization.normalize(utf8, using: :nfd)
|
|
||||||
end
|
|
||||||
|
|
||||||
test 'mathjax assets are served' do
|
test 'mathjax assets are served' do
|
||||||
get '/gollum/assets/mathjax/MathJax.js'
|
get '/gollum/assets/mathjax/MathJax.js'
|
||||||
assert last_response.ok?
|
assert last_response.ok?
|
||||||
end
|
end
|
||||||
|
|
||||||
test "UTF-8 headers href preserved" do
|
test "UTF-8 headers href preserved" do
|
||||||
page = 'utfh1'
|
page_content = <<~TEXT
|
||||||
text = nfd('한글')
|
## 한글
|
||||||
|
|
||||||
# don't use h1 or it will be promoted to replace file name
|
Test page "utfh1" content.
|
||||||
# which doesn't generate a normal header link
|
TEXT
|
||||||
@wiki.write_page(page, :markdown, '## ' + text,
|
|
||||||
{ :name => 'user1', :email => 'user1' });
|
|
||||||
|
|
||||||
get page
|
@wiki.write_page('utfh1',
|
||||||
expected = "<h2 class=\"editable\"><a class=\"anchor\" (href|id)=\"(#)?#{text}\" (href|id)=\"(#)?#{text}\"></a>#{text}</h2>"
|
:markdown,
|
||||||
actual = nfd(last_response.body)
|
page_content,
|
||||||
|
{name: 'user1', email: 'user1'})
|
||||||
|
|
||||||
assert_match /#{expected}/, actual
|
get 'utfh1'
|
||||||
|
expected = "<h2 class=\"editable\"><a class=\"anchor\" (href|id)=\"(#)?한글\" (href|id)=\"(#)?한글\"></a>한글</h2>"
|
||||||
|
|
||||||
|
assert_match /#{expected}/, last_response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'rss feed' do
|
test 'rss feed' do
|
||||||
|
|||||||
Reference in New Issue
Block a user