42 lines (39 loc) · 1.06 KB
/
CI.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
name: CI
on:
push:
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest]
ruby:
- 2.7.8 # latest of 2.x serie (EOL) for old chef version compat
- 3.1.4 # latest compatible of 3.x serie - Chef < 18 is not compatible with ruby 3.2
runs-on: ${{ matrix.os }}
steps:
- name: Enforce linefeeds
run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [tests]
steps:
- uses: actions/checkout@v4
- name: Publish to supermarket
uses: afaundez/chef-supermarket-action@8cdbe1cccbe1ecd8685b2ea8f48780135bae7cee
with:
user: annih
cookbook: updatable-attributes
category: Other
env:
SUPERMARKET_API_KEY: ${{ secrets.SUPERMARKET_API_KEY }}