-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from travis-ci/freebsd_pkg_addon
Freebsd pkg addon
- Loading branch information
Showing
6 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
require 'travis/yml/schema/type' | ||
|
||
module Travis | ||
module Yml | ||
module Schema | ||
module Def | ||
module Addon | ||
class Pkg < Addon | ||
register :pkg | ||
|
||
def define | ||
prefix :packages | ||
|
||
map :packages, to: :seq, alias: :package, summary: 'Package names', eg: 'cmake' | ||
map :branch, to: :str, summary: 'Packages branch', eg: 'quarterly' | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
describe Travis::Yml, 'addon: pkg' do | ||
subject { described_class.apply(parse(yaml)) } | ||
|
||
describe 'packages given a string' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
packages: str | ||
) | ||
it { should serialize_to addons: { pkg: { packages: ['str'] } } } | ||
it { should_not have_msg } | ||
end | ||
|
||
describe 'package given a string (alias)' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
package: str | ||
) | ||
it { should serialize_to addons: { pkg: { packages: ['str'] } } } | ||
it { should have_msg [:info, :'addons.pkg', :alias_key, alias: 'package', key: 'packages'] } | ||
end | ||
|
||
describe 'packages given a seq' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
packages: | ||
- str | ||
) | ||
it { should serialize_to addons: { pkg: { packages: ['str'] } } } | ||
it { should_not have_msg } | ||
end | ||
|
||
describe 'package given a seq (alias)' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
package: | ||
- str | ||
) | ||
it { should serialize_to addons: { pkg: { packages: ['str'] } } } | ||
it { should have_msg [:info, :'addons.pkg', :alias_key, alias: 'package', key: 'packages'] } | ||
end | ||
|
||
describe 'branch given a string' do | ||
yaml %( | ||
addons: | ||
pkg: | ||
branch: str | ||
) | ||
it { should serialize_to addons: { pkg: { branch: 'str' } } } | ||
it { should_not have_msg } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
describe Travis::Yml::Schema::Def::Addon::Pkg do | ||
subject { Travis::Yml.schema[:definitions][:addon][:pkg] } | ||
|
||
# it { puts JSON.pretty_generate(subject) } | ||
|
||
it do | ||
should eq( | ||
'$id': :pkg, | ||
title: 'Pkg', | ||
anyOf: [ | ||
{ | ||
type: :object, | ||
properties: { | ||
packages: { | ||
'$ref': '#/definitions/type/strs', | ||
aliases: [ | ||
:package | ||
], | ||
summary: 'Package names', | ||
example: 'cmake' | ||
}, | ||
branch: { | ||
type: :string, | ||
summary: 'Packages branch', | ||
example: 'quarterly' | ||
} | ||
}, | ||
additionalProperties: false, | ||
prefix: { | ||
key: :packages | ||
}, | ||
normal: true, | ||
changes: [ | ||
{ | ||
change: :enable | ||
} | ||
] | ||
}, | ||
{ | ||
'$ref': '#/definitions/type/strs', | ||
example: 'cmake' | ||
}, | ||
{ | ||
type: :boolean | ||
} | ||
], | ||
normal: true, | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ | |
jwts | ||
sauce_connect | ||
snaps | ||
pkg | ||
sonarcloud | ||
), | ||
deploy: %i( | ||
|