Add TESTING.md #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |