Permalink
Browse files

Merge pull request #72 from travis-ci/meat-windows

Add windows and associated languages
  • Loading branch information...
meatballhat committed Sep 28, 2018
2 parents 5acffc0 + 9cd3489 commit a6573790ccf495985ff6ec0857dcb5a8891597a9
@@ -15,6 +15,7 @@ def define
value :precise
value :xenial, edge: true
value :osx, alias: %i(mac macos ios)
value :'server-2016', edge: true
end
end
end
@@ -12,6 +12,16 @@ module Def
# TODO list supported languages instead?
osx: %i(php perl erlang groovy clojure scala haskell)
}
SUPPORTED = {
windows: %i(
bash
csharp
powershell
script
sh
shell
)
}
class Oss < Type::Seq
register :oss
@@ -20,6 +30,7 @@ def define
type Os
default :linux, except: { language: UNSUPPORTED[:linux] }
default :osx, except: { language: UNSUPPORTED[:osx] }
default :windows, only: { language: SUPPORTED[:windows] }
end
end
@@ -31,8 +42,10 @@ def define
default :linux, except: { language: UNSUPPORTED[:linux] }
default :osx, except: { language: UNSUPPORTED[:osx] }
default :windows, only: { language: SUPPORTED[:windows] }
value :linux, alias: %i(ubuntu), except: { language: UNSUPPORTED[:linux] }
value :osx, alias: %i(mac macos ios), except: { language: UNSUPPORTED[:osx] }
value :windows, alias: %i(win), only: { language: SUPPORTED[:windows] }
end
end
end
@@ -130,9 +130,9 @@
end
describe 'given an unknown os' do
let(:input) { { matrix: { include: { os: 'windows' } } } }
let(:input) { { matrix: { include: { os: 'forth' } } } }
it { expect(matrix[:include]).to eq [os: 'linux'] }
it { expect(msgs).to include [:warn, :'matrix.include.os', :unknown_default, value: 'windows', default: 'linux'] }
it { expect(msgs).to include [:warn, :'matrix.include.os', :unknown_default, value: 'forth', default: 'linux'] }
end
end
@@ -28,9 +28,9 @@
end
describe 'drops an unknown values' do
let(:input) { { os: 'windows' } }
let(:input) { { os: 'forth' } }
it { expect(os).to eq ['linux'] }
it { expect(msgs).to include([:warn, :os, :unknown_default, value: 'windows', default: 'linux']) }
it { expect(msgs).to include([:warn, :os, :unknown_default, value: 'forth', default: 'linux']) }
end
describe 'supports aliases' do
@@ -13,7 +13,8 @@
{ value: 'trusty' },
{ value: 'precise' },
{ value: 'xenial', edge: true },
{ value: 'osx', alias: ['mac', 'macos', 'ios'] }
{ value: 'osx', alias: ['mac', 'macos', 'ios'] },
{ value: 'server-2016', edge: true }
]
)
end
@@ -15,19 +15,32 @@
}
},
{
value: 'osx',
except: {
language: [
:php,
:perl,
:erlang,
:groovy,
:clojure,
:scala,
:haskell
]
}
value: 'osx',
except: {
language: [
:php,
:perl,
:erlang,
:groovy,
:clojure,
:scala,
:haskell
]
}
},
{
value: 'windows',
only: {
language: [
:bash,
:csharp,
:powershell,
:script,
:sh,
:shell
]
}
}
],
types: [
{
@@ -37,26 +50,39 @@
defaults: [
{
value: 'linux',
except: {
language: [
:'objective-c'
]
}
except: {
language: [
:'objective-c'
]
}
},
{
value: 'osx',
except: {
language: [
:php,
:perl,
:erlang,
:groovy,
:clojure,
:scala,
:haskell
]
}
value: 'osx',
except: {
language: [
:php,
:perl,
:erlang,
:groovy,
:clojure,
:scala,
:haskell
]
}
},
{
value: 'windows',
only: {
language: [
:bash,
:csharp,
:powershell,
:script,
:sh,
:shell
]
}
}
],
values: [
{
@@ -88,6 +114,22 @@
:haskell
]
}
},
{
value: 'windows',
alias: [
'win'
],
only: {
language: [
:bash,
:csharp,
:powershell,
:script,
:sh,
:shell
]
}
}
]
}

0 comments on commit a657379

Please sign in to comment.