|
12 | 12 | uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" |
13 | 13 | secrets: "inherit" |
14 | 14 |
|
15 | | - Acceptance: |
16 | | - needs: Spec |
17 | | - uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@4dee504a6623266617ce7b47ae3ecbc1939788ad" |
18 | | - secrets: "inherit" |
| 15 | + setup_matrix: |
| 16 | + name: "Setup Test Matrix" |
| 17 | + runs-on: ubuntu-latest |
| 18 | + outputs: |
| 19 | + acceptance_matrix: ${{ steps.get-matrix.outputs.matrix }} |
| 20 | + |
| 21 | + env: |
| 22 | + BUNDLE_WITHOUT: release_prep |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: "Checkout" |
| 26 | + uses: "actions/checkout@v4" |
| 27 | + |
| 28 | + - name: "Setup ruby" |
| 29 | + uses: "ruby/setup-ruby@v1" |
| 30 | + with: |
| 31 | + ruby-version: "3.1" |
| 32 | + bundler-cache: true |
| 33 | + |
| 34 | + - name: "Bundle environment" |
| 35 | + run: | |
| 36 | + echo ::group::bundler environment |
| 37 | + bundle env |
| 38 | + echo ::endgroup:: |
| 39 | +
|
| 40 | + - name: Setup Test Matrix |
| 41 | + id: get-matrix |
| 42 | + run: | |
| 43 | + bundle exec matrix_from_metadata_v3 --puppet-exclude 7 |
| 44 | +
|
| 45 | + acceptance: |
| 46 | + name: "Acceptance tests (${{matrix.platforms.label}}, ${{matrix.collection}})" |
| 47 | + needs: "setup_matrix" |
| 48 | + runs-on: ${{ inputs.runs_on || matrix.platforms.runner }} |
| 49 | + timeout-minutes: 180 |
| 50 | + strategy: |
| 51 | + fail-fast: false |
| 52 | + matrix: ${{ fromJson( needs.setup_matrix.outputs.acceptance_matrix ) }} |
| 53 | + |
| 54 | + env: |
| 55 | + BUNDLE_WITHOUT: release_prep |
| 56 | + PUPPET_GEM_VERSION: '~> 8.9' |
| 57 | + FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set? |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: "Checkout" |
| 61 | + uses: "actions/checkout@v4" |
| 62 | + |
| 63 | + - name: "Setup ruby" |
| 64 | + uses: "ruby/setup-ruby@v1" |
| 65 | + with: |
| 66 | + ruby-version: "3.1" |
| 67 | + bundler-cache: true |
| 68 | + |
| 69 | + - name: "Bundle environment" |
| 70 | + run: | |
| 71 | + echo ::group::bundler environment |
| 72 | + bundle env |
| 73 | + echo ::endgroup:: |
| 74 | +
|
| 75 | + - name: "Provision environment" |
| 76 | + run: | |
| 77 | + DOCKER_RUN_OPTS='' |
| 78 | + bundle exec rake "litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }},$DOCKER_RUN_OPTS]" |
| 79 | + # Redact password |
| 80 | + FILE='spec/fixtures/litmus_inventory.yaml' |
| 81 | + sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true |
| 82 | +
|
| 83 | + - name: "Install Puppet agent" |
| 84 | + run: | |
| 85 | + bundle exec rake 'litmus:install_agent' |
| 86 | +
|
| 87 | + - name: "Install module" |
| 88 | + run: | |
| 89 | + bundle exec rake 'litmus:install_module' |
| 90 | +
|
| 91 | + - name: "Run acceptance tests" |
| 92 | + run: | |
| 93 | + bundle exec rake 'litmus:acceptance:parallel' |
| 94 | +
|
| 95 | + - name: "Remove test environment" |
| 96 | + if: ${{ always() }} |
| 97 | + continue-on-error: true |
| 98 | + run: | |
| 99 | + if [[ -f spec/fixtures/litmus_inventory.yaml ]]; then |
| 100 | + bundle exec rake 'litmus:tear_down' |
| 101 | + fi |
0 commit comments