File tree 5 files changed +57
-6
lines changed 5 files changed +57
-6
lines changed Original file line number Diff line number Diff line change
1
+ * text =auto
Original file line number Diff line number Diff line change
1
+ name : Continuous Integration
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ - /.*-stable/
8
+ pull_request :
9
+ branches :
10
+ - master
11
+ - /.*-stable/
12
+
13
+ jobs :
14
+ ci :
15
+ name : ' SUITE: ${{ matrix.test_suite }} / OS: ${{ matrix.os }}'
16
+ runs-on : ${{ matrix.os }}
17
+ strategy :
18
+ fail-fast : false
19
+ matrix :
20
+ test_suite :
21
+ - test
22
+ - default-site
23
+ os :
24
+ - ubuntu-latest
25
+ - windows-latest
26
+ steps :
27
+ - uses : actions/checkout@v1
28
+ with :
29
+ fetch-depth : 1
30
+ - name : Set up Ruby 2.6
31
+ uses : actions/setup-ruby@v1
32
+ with :
33
+ ruby-version : 2.6.x
34
+ - name : ' Update Rubygems & Bundler'
35
+ run : ' gem update --system --no-document && gem update bundler --no-document'
36
+ - name : Set up bundle
37
+ run : bundle install --jobs 4 --retry 3
38
+ - name : Run Test Suite
39
+ run : bash script/cibuild
40
+ env :
41
+ CI : true
42
+ TEST_SUITE : ${{ matrix.test_suite }}
Original file line number Diff line number Diff line change @@ -80,6 +80,17 @@ def theme_dir(*subdirs)
80
80
def test_dir ( *subdirs )
81
81
root_dir ( "test" , *subdirs )
82
82
end
83
+
84
+ def temp_dir ( *subdirs )
85
+ if Utils ::Platforms . windows?
86
+ drive = Dir . pwd . sub ( %r!^([^\/ ]+).*! , '\1' )
87
+ temp_root = File . join ( drive , "tmp" )
88
+ else
89
+ temp_root = "/tmp"
90
+ end
91
+
92
+ File . join ( temp_root , *subdirs )
93
+ end
83
94
end
84
95
85
96
class JekyllUnitTest < Minitest ::Test
Original file line number Diff line number Diff line change
1
+ * - text
Original file line number Diff line number Diff line change @@ -32,19 +32,15 @@ def read_posts
32
32
33
33
should "have an array for plugins if passed as a string" do
34
34
site = Site . new ( site_configuration ( "plugins_dir" => "/tmp/plugins" ) )
35
- array = Utils :: Platforms . windows? ? [ "C:/tmp/ plugins"] : [ "/tmp/plugins" ]
35
+ array = [ temp_dir ( " plugins") ]
36
36
assert_equal array , site . plugins
37
37
end
38
38
39
39
should "have an array for plugins if passed as an array" do
40
40
site = Site . new ( site_configuration (
41
41
"plugins_dir" => [ "/tmp/plugins" , "/tmp/otherplugins" ]
42
42
) )
43
- array = if Utils ::Platforms . windows?
44
- [ "C:/tmp/plugins" , "C:/tmp/otherplugins" ]
45
- else
46
- [ "/tmp/plugins" , "/tmp/otherplugins" ]
47
- end
43
+ array = [ temp_dir ( "plugins" ) , temp_dir ( "otherplugins" ) ]
48
44
assert_equal array , site . plugins
49
45
end
50
46
You can’t perform that action at this time.
0 commit comments