service_acceptance #864
This file contains hidden or 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: "service_test" | |
on: | |
repository_dispatch: | |
types: [service_acceptance] | |
env: | |
SERVICE_URL: ${{ github.event.client_payload.facade_url }} | |
jobs: | |
setup_matrix: | |
name: "Setup Test Matrix" | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.get-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
if: ${{ github.repository_owner == 'puppetlabs' }} | |
- name: Activate Ruby 3.2 | |
uses: ruby/setup-ruby@v1 | |
if: ${{ github.repository_owner == 'puppetlabs' }} | |
with: | |
ruby-version: "3.2" | |
bundler-cache: true | |
- name: Print bundle environment | |
if: ${{ github.repository_owner == 'puppetlabs' }} | |
run: | | |
echo ::group::bundler environment | |
bundle env | |
echo ::endgroup:: | |
- name: Setup Acceptance Test Matrix | |
id: get-matrix | |
run: | | |
bundle exec matrix_from_metadata_v2 | |
Acceptance: | |
name: "${{matrix.platforms.label}}, ${{matrix.collection}}" | |
needs: | |
- setup_matrix | |
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
- name: Activate Ruby 3.2 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2" | |
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 }}]' | |
echo ::group::=== REQUEST === | |
cat request.json || true | |
echo | |
echo ::endgroup:: | |
echo ::group::=== INVENTORY === | |
if [ -f 'spec/fixtures/litmus_inventory.yaml' ]; | |
then | |
FILE='spec/fixtures/litmus_inventory.yaml' | |
elif [ -f 'inventory.yaml' ]; | |
then | |
FILE='inventory.yaml' | |
fi | |
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true | |
echo ::endgroup:: | |
- 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: | | |
bundle exec rake 'litmus:tear_down' |