-
Notifications
You must be signed in to change notification settings - Fork 44
66 lines (60 loc) · 1.81 KB
/
publish.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Test and publish prometheus-exporters cookbook to Supermarket
on: [push, pull_request]
env:
KITCHEN_YAML: .kitchen.yml
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Setup Ruby 2.7.1
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Prepare bundle
run: |
bundle config path vendor/bundle
gem install bundler
bundle install
- name: Check cookbook code style
run: bundle exec cookstyle
- name: Lint cookbook
run: bundle exec foodcritic --context --epic-fail any .
- name: Run rspec tests
run: bundle exec rspec -fd test/cookbooks/testrig/spec/chefspec.r
kitchen-test:
runs-on: ubuntu-20.04
needs: lint
strategy:
matrix:
chef-version: [14, 15, 16]
os:
- amazonlinux
- amazonlinux-2
- centos-8
- ubuntu-2004
steps:
- uses: actions/checkout@v1
- name: Setup Ruby 2.7.1
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Prepare bundle
run: |
bundle config path vendor/bundle
gem install bundler
bundle install
- name: Run Test Kitchen against chef-${{ matrix.chef-version}}-${{ matrix.os }}
run: bundle exec kitchen test chef-${{ matrix.chef-version}}-${{ matrix.os }}