Unverified Commit 650ba14a authored by Tim Smith's avatar Tim Smith Committed by GitHub
Browse files

Merge pull request #147 from chocolatey-community/github_actions

Replace Travis testing with Github Actions
parents e062cc87 46793adc
name: delivery
on: [push, pull_request]
jobs:
delivery:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Run Chef Delivery
uses: actionshub/chef-delivery@master
env:
CHEF_LICENSE: accept-no-persist
\ No newline at end of file
# Use Travis's cointainer based infrastructure
sudo: false
addons:
apt:
sources:
- chef-stable-precise
packages:
- chefdk
# Don't `bundle install`
install: echo "skip bundle install"
branches:
only:
- master
# Ensure we make ChefDK's Ruby the default
before_script:
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
script:
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/cookstyle --version
- /opt/chefdk/embedded/bin/foodcritic --version
- /opt/chefdk/bin/chef exec delivery local all
# chocolatey Cookbook
[![Cookbook Version](https://img.shields.io/cookbook/v/chocolatey.svg)](https://supermarket.getchef.com/cookbooks/chocolatey) [![Build Status](http://img.shields.io/travis/chocolatey/chocolatey-cookbook/master.svg)](https://travis-ci.org/chocolatey/chocolatey-cookbook)
[![Cookbook Version](https://img.shields.io/cookbook/v/chocolatey.svg)](https://supermarket.getchef.com/cookbooks/chocolatey) ![delivery](https://github.com/chocolatey-community/chocolatey-cookbook/workflows/delivery/badge.svg)
Install Chocolatey with the default recipe.
......@@ -10,9 +10,9 @@ Install Chocolatey with the default recipe.
- Windows
### Chef
### Chef Infra Client
- 12.7 or greater
- 12.15 or greater
## Notes
......
......@@ -3,7 +3,6 @@ maintainer 'Guilhem Lettron'
maintainer_email 'guilhem.lettron@youscribe.com'
license 'Apache-2.0'
description 'Install Chocolatey on Windows'
long_description 'Installs the Chocolatey package manager for Windows.'
version '2.0.1'
source_url 'https://github.com/chocolatey/chocolatey-cookbook'
......@@ -11,4 +10,4 @@ issues_url 'https://github.com/chocolatey/chocolatey-cookbook/issues'
supports 'windows'
chef_version '>= 12.7' if respond_to?(:chef_version)
chef_version '>= 12.15'
#
# Cookbook Name:: chocolatey
# Cookbook:: chocolatey
# recipe:: default
# Author:: Guilhem Lettron <guilhem.lettron@youscribe.com>
#
# Copyright 2012, Societe Publica.
# Copyright 2015, Doug Ireton
# Copyright:: 2012, Societe Publica.
# Copyright:: 2015, Doug Ireton
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -22,7 +22,7 @@ unless platform_family?('windows')
return "Chocolatey install not supported on #{node['platform_family']}"
end
Chef::Resource.send(:include, Chocolatey::Helpers)
Chef::Resource.include Chocolatey::Helpers
install_ps1 = File.join(Chef::Config['file_cache_path'], 'chocolatey-install.ps1')
......
example_id | status | run_time |
--------------------------------------- | ------ | --------------- |
./spec/recipes/default_spec.rb[1:1:1] | passed | 0.0881 seconds |
./spec/recipes/default_spec.rb[1:1:2] | passed | 0.06005 seconds |
./spec/recipes/default_spec.rb[1:1:3] | passed | 0.08716 seconds |
./spec/recipes/default_spec.rb[1:1:4:1] | passed | 0.08661 seconds |
./spec/recipes/default_spec.rb[1:1:5:1] | passed | 0.0842 seconds |
./spec/recipes/default_spec.rb[1:1:1] | passed | 0.02305 seconds |
./spec/recipes/default_spec.rb[1:1:2] | passed | 0.02748 seconds |
./spec/recipes/default_spec.rb[1:1:3] | passed | 0.04117 seconds |
./spec/recipes/default_spec.rb[1:1:4:1] | passed | 0.04306 seconds |
./spec/recipes/default_spec.rb[1:1:5:1] | passed | 0.02668 seconds |
RSpec.describe 'chocolatey::default' do
context 'on Windows 2012r2' do
context 'on Windows' do
let(:proxy) { nil }
let(:proxy_config) { nil }
let(:proxy_env) { nil }
......@@ -12,8 +12,9 @@ RSpec.describe 'chocolatey::default' do
allow(Chef::Config).to receive(:[]).and_call_original
allow(Chef::Config).to receive(:[]).with('https_proxy').and_return(proxy_config)
allow(Chef::Config).to receive(:[]).with('file_cache_path').and_return('c:/chef/cache')
ChefSpec::SoloRunner.new(
platform: 'windows', version: '2012R2'
platform: 'windows'
).converge(described_recipe)
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment