Skip to content

Commit f1cc1b9

Browse files
committed
ci(github+windows): install and use Chef embedded Ruby
1 parent 7144bc0 commit f1cc1b9

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

.github/workflows/kitchen.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: CI
2+
name: kitchen
33

44
'on': [push, pull_request]
55

@@ -10,30 +10,44 @@ env:
1010
KITCHEN_LOCAL_YAML: kitchen.github.yml
1111

1212
jobs:
13-
build:
13+
test:
1414
runs-on: windows-latest
1515

1616
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/cache@v1
17+
- name: Check out code
18+
uses: actions/checkout@v2
19+
- name: Install Chef
20+
uses: actionshub/[email protected]
21+
with:
22+
project: chef
23+
version: 16.10.8
24+
- name: Add Chef bindir to PATH
25+
uses: myci-actions/export-env-var-powershell@1
26+
with:
27+
name: PATH
28+
value: "C:\\opscode\\chef\\bin;\
29+
C:\\opscode\\chef\\embedded\\bin;$env:PATH"
30+
- name: Set up Bundler cache
31+
uses: actions/cache@v1
1932
with:
2033
path: vendor/bundle
2134
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
2235
restore-keys: |
2336
${{ runner.os }}-gems-
24-
- shell: powershell
37+
- name: Set up test user
2538
run: |
2639
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
2740
New-LocalUser $env:machine_user -Password $password
2841
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
29-
- shell: powershell
42+
- name: Set up WinRM
3043
run: >
3144
Set-WSManQuickConfig -Force;
3245
Set-WSManInstance -ResourceURI winrm/config/service
3346
-ValueSet @{AllowUnencrypted="true"}
34-
- run: gem install bundler --quiet --no-document
35-
- name: Bundle install
47+
- name: Run Bundler
3648
run: |
49+
ruby --version
3750
bundle config path vendor/bundle
3851
bundle install --jobs 4 --retry 3
39-
- run: bundle exec kitchen test
52+
- name: Run Test Kitchen
53+
run: bundle exec kitchen verify

Gemfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
source 'https://rubygems.org'
44

5-
# Versions of `chef-utils` newer than `16.6.14` depend on Ruby 2.6 or
6-
# newer, but the GitHub Actions Windows image comes with Ruby 2.5.8
7-
gem 'chef-utils', '~> 16.6.14'
85
# Use the latest version of `inspec` prior to `4.23.4`, which introduces a
96
# regression where the diff isn't displayed when comparing using `eq`.
107
gem 'inspec', '~> 4.22.22'

Gemfile.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ PLATFORMS
525525
ruby
526526

527527
DEPENDENCIES
528-
chef-utils (~> 16.6.14)
529528
inspec (~> 4.22.22)
530529
kitchen-docker!
531530
kitchen-inspec (>= 2.2.1)

0 commit comments

Comments
 (0)