Skip to content
Permalink
Browse files

Ci/GitHub actions (#7822)

Merge pull request 7822
  • Loading branch information...
ethomson authored and jekyllbot committed Sep 26, 2019
1 parent f00a642 commit 275702edd5df5d2dda86ccd7ff341732a11d83a9
Showing with 57 additions and 6 deletions.
  1. +1 −0 .gitattributes
  2. +42 −0 .github/workflows/ci.yml
  3. +11 −0 test/helper.rb
  4. +1 −0 test/source/.gitattributes
  5. +2 −6 test/test_site.rb
@@ -0,0 +1 @@
* text=auto
@@ -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 }}
@@ -80,6 +80,17 @@ def theme_dir(*subdirs)
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
@@ -0,0 +1 @@
* -text
@@ -32,19 +32,15 @@ def read_posts

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

should "have an array for plugins if passed as an array" do
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

0 comments on commit 275702e

Please sign in to comment.
You can’t perform that action at this time.