Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 101bcfb02f | |||
| 8e9ab89783 | |||
| 902ada7a3e |
@@ -34,22 +34,5 @@ jobs:
|
|||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
- name: docker state
|
- name: docker state
|
||||||
run: docker image ls
|
run: docker image ls
|
||||||
- name: Set up Ruby
|
- name: Run gollum as test
|
||||||
uses: ruby/setup-ruby@v1
|
run: docker run -e CI=true ${{ env.CI_IMAGE }} --irb
|
||||||
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,13 +248,6 @@ task :precompile do
|
|||||||
"It's possible that you just need to install `yarn` on your system."
|
"It's possible that you just need to install `yarn` on your system."
|
||||||
end
|
end
|
||||||
|
|
||||||
require 'uglifier'
|
|
||||||
module Precious
|
|
||||||
module Assets
|
|
||||||
JS_COMPRESSOR = ::Uglifier.new(harmony: true)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
require './lib/gollum/app.rb'
|
require './lib/gollum/app.rb'
|
||||||
|
|
||||||
# Next, configure the Sprockets asset pipeline and precompile production-
|
# Next, configure the Sprockets asset pipeline and precompile production-
|
||||||
|
|||||||
Executable → Regular
+1
-1
@@ -17,7 +17,7 @@ module Gollum
|
|||||||
KEYBINDINGS = ['default', 'vim', 'emacs']
|
KEYBINDINGS = ['default', 'vim', 'emacs']
|
||||||
|
|
||||||
::I18n.available_locales = [:en]
|
::I18n.available_locales = [:en]
|
||||||
::I18n.load_path = Dir[::File.expand_path("../gollum/locales", __FILE__) + "/*.yml"]
|
::I18n.load_path = Dir[::File.expand_path("lib/gollum/locales") + "/*.yml"]
|
||||||
|
|
||||||
def self.assets_path
|
def self.assets_path
|
||||||
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
|
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
require 'octicons'
|
require 'octicons'
|
||||||
|
require 'uglifier'
|
||||||
|
|
||||||
module Precious
|
module Precious
|
||||||
module Assets
|
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)
|
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'
|
ASSET_URL = 'gollum/assets'
|
||||||
JS_COMPRESSOR = :uglify unless defined?(JS_COMPRESSOR)
|
|
||||||
|
|
||||||
def self.sprockets(dir = File.dirname(File.expand_path(__FILE__)))
|
def self.sprockets(dir = File.dirname(File.expand_path(__FILE__)))
|
||||||
env = Sprockets::Environment.new
|
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/images')
|
||||||
env.append_path ::File.join(dir, 'public/gollum/fonts')
|
env.append_path ::File.join(dir, 'public/gollum/fonts')
|
||||||
|
|
||||||
env.js_compressor = Precious::Assets::JS_COMPRESSOR unless Precious::App.development?
|
env.js_compressor = ::Uglifier.new(harmony: true) unless Precious::App.development?
|
||||||
env.css_compressor = :scss
|
env.css_compressor = :scss
|
||||||
|
|
||||||
env.context_class.class_eval do
|
env.context_class.class_eval do
|
||||||
|
|||||||
@@ -14,15 +14,7 @@ CAPYBARA_DRIVER =
|
|||||||
|
|
||||||
Capybara.default_driver = CAPYBARA_DRIVER
|
Capybara.default_driver = CAPYBARA_DRIVER
|
||||||
Capybara.enable_aria_label = true
|
Capybara.enable_aria_label = true
|
||||||
|
|
||||||
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
|
Capybara.server = :webrick
|
||||||
end
|
|
||||||
|
|
||||||
def console_log(page, level = :severe)
|
def console_log(page, level = :severe)
|
||||||
page.driver.browser.logs.get(:browser).select { |log| log.level == level.to_s.upcase }
|
page.driver.browser.logs.get(:browser).select { |log| log.level == level.to_s.upcase }
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ end
|
|||||||
|
|
||||||
def expected_errors
|
def expected_errors
|
||||||
Regexp.union([
|
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
|
end
|
||||||
|
|
||||||
@@ -22,11 +21,7 @@ context 'Frontend with mathjax and mermaid' do
|
|||||||
@path = cloned_testpath("examples/lotr.git")
|
@path = cloned_testpath("examples/lotr.git")
|
||||||
@wiki = Gollum::Wiki.new(@path)
|
@wiki = Gollum::Wiki.new(@path)
|
||||||
Precious::App.set(:gollum_path, @path)
|
Precious::App.set(:gollum_path, @path)
|
||||||
Precious::App.set(:wiki_options, {
|
Precious::App.set(:wiki_options, {mathjax: true, mermaid: true})
|
||||||
mathjax: true,
|
|
||||||
mermaid: true,
|
|
||||||
mathjax_config: 'mathjax.config.js'
|
|
||||||
})
|
|
||||||
Capybara.app = Precious::App
|
Capybara.app = Precious::App
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user