Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5dd31e32c6 | |||
| 869292ed1e | |||
| 5ed777834d | |||
| 0098e9187a | |||
| e7b324f9ff | |||
| c48c7dab0b | |||
| aac6c9da70 | |||
| af570a97e3 | |||
| 193f449058 |
@@ -34,5 +34,22 @@ jobs:
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
- name: docker state
|
||||
run: docker image ls
|
||||
- name: Run gollum as test
|
||||
run: docker run -e CI=true ${{ env.CI_IMAGE }} --irb
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 3.0.0
|
||||
bundler-cache: true
|
||||
- name: Install Chromedriver
|
||||
uses: nanasess/setup-chromedriver@v1
|
||||
- run: |
|
||||
export DISPLAY=:99
|
||||
chromedriver --url-base=/wd/hub &
|
||||
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
|
||||
- name: Run gollum from Docker
|
||||
run: |
|
||||
git clone test/examples/lotr.git /tmp/lotr.git
|
||||
RUNNER_TRACKING_ID="" docker run --rm -p 4567:4567 -v /tmp/lotr.git:/wiki -e CI=true ${{ env.CI_IMAGE }} --mathjax --mermaid &
|
||||
sleep 10
|
||||
netstat -lt
|
||||
- name: Run capybara tests against Dockerized instance
|
||||
run: "GOLLUM_CAPYBARA_URL=http://127.0.0.1:4567 bundle exec rake test:capybara"
|
||||
@@ -248,6 +248,13 @@ task :precompile do
|
||||
"It's possible that you just need to install `yarn` on your system."
|
||||
end
|
||||
|
||||
require 'uglifier'
|
||||
module Precious
|
||||
module Assets
|
||||
JS_COMPRESSOR = ::Uglifier.new(harmony: true)
|
||||
end
|
||||
end
|
||||
|
||||
require './lib/gollum/app.rb'
|
||||
|
||||
# Next, configure the Sprockets asset pipeline and precompile production-
|
||||
|
||||
Regular → Executable
+2
-2
@@ -24,8 +24,8 @@ Gem::Specification.new do |s|
|
||||
s.add_dependency 'gollum-lib', '~> 5.1'
|
||||
s.add_dependency 'kramdown', '~> 2.3'
|
||||
s.add_dependency 'kramdown-parser-gfm', '~> 1.1.0'
|
||||
s.add_dependency 'sinatra', '~> 2.0'
|
||||
s.add_dependency 'sinatra-contrib', '~> 2.0'
|
||||
s.add_dependency 'sinatra', '~> 3.0'
|
||||
s.add_dependency 'sinatra-contrib', '~> 3.0'
|
||||
s.add_dependency 'mustache-sinatra', '>= 1.0.1', '< 2'
|
||||
s.add_dependency 'useragent', '~> 0.16.2'
|
||||
s.add_dependency 'gemojione', '~> 4.1'
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ module Gollum
|
||||
KEYBINDINGS = ['default', 'vim', 'emacs']
|
||||
|
||||
::I18n.available_locales = [:en]
|
||||
::I18n.load_path = Dir[::File.expand_path("lib/gollum/locales") + "/*.yml"]
|
||||
::I18n.load_path = Dir[::File.expand_path("../gollum/locales", __FILE__) + "/*.yml"]
|
||||
|
||||
def self.assets_path
|
||||
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
require 'octicons'
|
||||
require 'uglifier'
|
||||
|
||||
module Precious
|
||||
module Assets
|
||||
MANIFEST = %w(app.js editor.js mermaid.js app.css criticmarkup.css fileview.css ie7.css print.css *.png *.jpg *.svg *.eot *.ttf)
|
||||
ASSET_URL = 'gollum/assets'
|
||||
JS_COMPRESSOR = :uglify unless defined?(JS_COMPRESSOR)
|
||||
|
||||
def self.sprockets(dir = File.dirname(File.expand_path(__FILE__)))
|
||||
env = Sprockets::Environment.new
|
||||
@@ -17,7 +17,7 @@ module Precious
|
||||
env.append_path ::File.join(dir, 'public/gollum/images')
|
||||
env.append_path ::File.join(dir, 'public/gollum/fonts')
|
||||
|
||||
env.js_compressor = ::Uglifier.new(harmony: true) unless Precious::App.development?
|
||||
env.js_compressor = Precious::Assets::JS_COMPRESSOR unless Precious::App.development?
|
||||
env.css_compressor = :scss
|
||||
|
||||
env.context_class.class_eval do
|
||||
|
||||
@@ -14,7 +14,15 @@ CAPYBARA_DRIVER =
|
||||
|
||||
Capybara.default_driver = CAPYBARA_DRIVER
|
||||
Capybara.enable_aria_label = true
|
||||
Capybara.server = :webrick
|
||||
|
||||
if ENV['GOLLUM_CAPYBARA_URL']
|
||||
Capybara.configure do |config|
|
||||
config.run_server = false
|
||||
config.app_host = ENV['GOLLUM_CAPYBARA_URL']
|
||||
end
|
||||
else
|
||||
Capybara.server = :webrick
|
||||
end
|
||||
|
||||
def console_log(page, level = :severe)
|
||||
page.driver.browser.logs.get(:browser).select { |log| log.level == level.to_s.upcase }
|
||||
|
||||
@@ -6,7 +6,8 @@ end
|
||||
|
||||
def expected_errors
|
||||
Regexp.union([
|
||||
%r{Refused to apply style from 'http:.*/gollum/create/custom.css'}
|
||||
%r{Refused to apply style from 'http:.*/gollum/create/custom.css'},
|
||||
%r{.*/gollum/create/mathjax.config.js - Failed to load resource: the server responded with a status of 403}
|
||||
])
|
||||
end
|
||||
|
||||
@@ -21,7 +22,11 @@ context 'Frontend with mathjax and mermaid' do
|
||||
@path = cloned_testpath("examples/lotr.git")
|
||||
@wiki = Gollum::Wiki.new(@path)
|
||||
Precious::App.set(:gollum_path, @path)
|
||||
Precious::App.set(:wiki_options, {mathjax: true, mermaid: true})
|
||||
Precious::App.set(:wiki_options, {
|
||||
mathjax: true,
|
||||
mermaid: true,
|
||||
mathjax_config: 'mathjax.config.js'
|
||||
})
|
||||
Capybara.app = Precious::App
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user