Skip to content

CI

CI #420

Workflow file for this run

---
name: CI
on:
pull_request:
branches: [ main ]
workflow_dispatch:
schedule:
- cron: 0 0 * * *
env:
HONEYCOMB_WRITEKEY: "${{ secrets.HONEYCOMB_WRITEKEY }}"
HONEYCOMB_DATASET: puppet-cassandra
jobs:
setup_matrix:
name: 'Setup test matrix'
runs-on: ubuntu-latest
outputs:
spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }}
acceptance_matrix: ${{ steps.get-matrix.outputs.matrix }}
extended_matrix: ${{ steps.ext-matrix.outputs.ext_matrix }}
steps:
- name: Checkout Source
uses: actions/checkout@v1
- name: Activate Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Get matrix
id: get-matrix
run: bundle exec matrix_from_metadata_v2
- name: Extend acceptance matrix
id: ext-matrix
run: echo ::set-output name=ext_matrix::$(echo $MAT $(cat acceptance_matrix_ext.json) | jq -s '.[0] as $puppet | .[1] as $cass | $puppet+ $cass ')
env:
MAT: ${{ steps.get-matrix.outputs.matrix }}
spec:
needs: setup_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix: ${{ fromJson(needs.setup_matrix.outputs.spec_matrix) }}
env:
PUPPET_GEM_VERSION: "${{ matrix.puppet_version }}"
name: Spec tests for Puppet ${{ matrix.puppet_version }} on Ruby ${{ matrix.ruby_version }}
steps:
- uses: actions/checkout@v2
- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
- name: Prepare environment
run: |
bundle config set --local without 'system_tests'
bundle install
- name: Spec tests
run: bundle exec rake parallel_spec
# acceptance:
# needs:
# - setup_matrix
# - spec
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix: ${{ fromJson(needs.setup_matrix.outputs.extended_matrix) }}
# name: Litmus tests Cassandra ${{ matrix.vars.release }} on ${{ matrix.platforms.label }} with ${{ matrix.collection }}
# steps:
# - uses: actions/checkout@v2
# - name: setup ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: 2.7
# - name: Prepare environment
# run: |
# bundle config set --local with 'system_tests'
# bundle install
# - name: Provision test environment
# run: "bundle exec rake 'litmus:provision[${{ matrix.platforms.provider }},${{ matrix.platforms.image }},{ release: ${{ matrix.vars.release }} }]'"
# - name: Install Agent
# run: bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
# - name: Install Module
# run: bundle exec rake 'litmus:install_module'
# - name: Running acceptance tests
# run: bundle exec rake 'litmus:acceptance:parallel'