Updating to the newer versions #9
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: "Acceptance tests" | |
on: [pull_request] | |
jobs: | |
setup_matrix: | |
name: "Setup Test Matrix" | |
runs-on: ubuntu-20.04 | |
outputs: | |
matrix: ${{ steps.get-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v2 | |
- name: Setup Acceptance Test Matrix | |
id: get-matrix | |
run: | | |
MATRIX=$(cat matrix.json |tr "\n" ' '|sed 's/\s\+/ /g') | |
echo "::set-output name=matrix::$MATRIX" | |
acceptance: | |
name: "${{matrix.platforms.label}}, ${{matrix.collection}}" | |
needs: | |
- setup_matrix | |
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v2 | |
- name: Activate Ruby 2.7 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "2.7" | |
bundler-cache: true | |
- name: Print bundle environment | |
run: | | |
echo ::group::bundler environment | |
bundle env | |
echo ::endgroup:: | |
- name: Provision test environment | |
run: | | |
bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]' | |
- name: Install agent | |
run: | | |
bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' | |
- name: Install module | |
run: | | |
bundle exec rake 'litmus:install_module' | |
- name: Run acceptance tests | |
run: | | |
bundle exec rake 'litmus:acceptance:parallel' | |
- name: Remove test environment | |
if: ${{ always() }} | |
continue-on-error: true | |
run: | | |
if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then | |
bundle exec rake 'litmus:tear_down' | |
fi |