Ci/GitHub actions (#7822)

Merge pull request 7822
This commit is contained in:
Edward Thomson 2019-09-26 18:32:59 +01:00 committed by jekyllbot
parent f00a642901
commit 275702edd5
5 changed files with 57 additions and 6 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=auto

42
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: Continuous Integration
on:
push:
branches:
- master
- /.*-stable/
pull_request:
branches:
- master
- /.*-stable/
jobs:
ci:
name: 'SUITE: ${{ matrix.test_suite }} / OS: ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
test_suite:
- test
- default-site
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Set up Ruby 2.6
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: 'Update Rubygems & Bundler'
run: 'gem update --system --no-document && gem update bundler --no-document'
- name: Set up bundle
run: bundle install --jobs 4 --retry 3
- name: Run Test Suite
run: bash script/cibuild
env:
CI: true
TEST_SUITE: ${{ matrix.test_suite }}

View File

@ -80,6 +80,17 @@ module DirectoryHelpers
def test_dir(*subdirs)
root_dir("test", *subdirs)
end
def temp_dir(*subdirs)
if Utils::Platforms.windows?
drive = Dir.pwd.sub(%r!^([^\/]+).*!, '\1')
temp_root = File.join(drive, "tmp")
else
temp_root = "/tmp"
end
File.join(temp_root, *subdirs)
end
end
class JekyllUnitTest < Minitest::Test

1
test/source/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* -text

View File

@ -32,7 +32,7 @@ class TestSite < JekyllUnitTest
should "have an array for plugins if passed as a string" do
site = Site.new(site_configuration("plugins_dir" => "/tmp/plugins"))
array = Utils::Platforms.windows? ? ["C:/tmp/plugins"] : ["/tmp/plugins"]
array = [temp_dir("plugins")]
assert_equal array, site.plugins
end
@ -40,11 +40,7 @@ class TestSite < JekyllUnitTest
site = Site.new(site_configuration(
"plugins_dir" => ["/tmp/plugins", "/tmp/otherplugins"]
))
array = if Utils::Platforms.windows?
["C:/tmp/plugins", "C:/tmp/otherplugins"]
else
["/tmp/plugins", "/tmp/otherplugins"]
end
array = [temp_dir("plugins"), temp_dir("otherplugins")]
assert_equal array, site.plugins
end