summaryrefslogtreecommitdiff
path: root/.github/workflows/kitchen.yml
blob: df7fd3e1b0c3e6d1997eb6cd36a4fad72fd2a7d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
name: kitchen

"on":
  pull_request:
  push:
    branches:
      - master

jobs:
  windows:
    strategy:
      fail-fast: false
      matrix:
        os: [windows-2019, windows-2016]
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v2
    - name: 'Install Chef/Ohai from Omnitruck'
      id: install_chef
      run: |
        . { Invoke-WebRequest -useb https://omnitruck.chef.io/install.ps1 } | Invoke-Expression; Install-Project -project chef -channel current
        $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH
        chef-client -v
        ohai -v
        rake --version
        bundle -v
    - name: 'Upgrade Chef/Ohai via Appbundler'
      id: upgrade
      run: |
        $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH
        $env:OHAI_VERSION = ( Select-String -Path .\Gemfile.lock -Pattern '(?<=ohai \()\d.*(?=\))' | ForEach-Object { $_.Matches[0].Value } )
        gem install appbundler appbundle-updater --no-doc
        appbundle-updater chef chef $env:BUILD_SOURCEVERSION --tarball --github chef/chef
        Write-Output "Installed Chef / Ohai release:"
        chef-client -v
        ohai -v
    - name: 'Run end_to_end::default recipe'
      id: run
      run: |
        cd kitchen-tests
        $env:PATH = "C:\opscode\chef\bin;C:\opscode\chef\embedded\bin;" + $env:PATH
        bundle config set without 'omnibus_package ruby_prof'
        bundle install --jobs=3 --retry=3 --path=vendor/bundle
        gem install berkshelf --no-doc
        # berks emits a ruby warning when it loads net/http due to a previously
        # defined constant. Even though it is just a warning, powershell immediately
        # exits 1. I'm not sure why but this just suppresses the warnings.
        $env:RUBYOPT="-W0"
        berks vendor cookbooks
        # restore the default warning level
        $env:RUBYOPT="-W1"
        chef-client -z -o end_to_end --chef-license accept-no-persist