|
5 | 5 | branches:
|
6 | 6 | - "main"
|
7 | 7 | workflow_dispatch:
|
| 8 | + |
| 9 | +env: |
| 10 | + SERVICE_URL: https://facade-maint-config-windows-use-ssh-6f3kfepqcq-ew.a.run.app/v1/provision |
8 | 11 |
|
9 | 12 | jobs:
|
10 | 13 | Spec:
|
11 | 14 | uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
|
12 | 15 | secrets: "inherit"
|
13 | 16 |
|
| 17 | + setup_matrix: |
| 18 | + name: "Setup Test Matrix" |
| 19 | + needs: "Spec" |
| 20 | + runs-on: ubuntu-latest |
| 21 | + outputs: |
| 22 | + matrix: ${{ steps.get-matrix.outputs.matrix }} |
| 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 Acceptance Test Matrix |
| 41 | + id: get-matrix |
| 42 | + run: | |
| 43 | + bundle exec matrix_from_metadata_v2 |
| 44 | +
|
14 | 45 | Acceptance:
|
15 |
| - needs: Spec |
16 |
| - uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" |
17 |
| - secrets: "inherit" |
| 46 | + name: "${{matrix.platforms.label}}, ${{matrix.collection}}" |
| 47 | + needs: |
| 48 | + - setup_matrix |
| 49 | + if: ${{ needs.setup_matrix.outputs.matrix != '{}' }} |
| 50 | + |
| 51 | + runs-on: ubuntu-latest |
| 52 | + strategy: |
| 53 | + fail-fast: false |
| 54 | + matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} |
| 55 | + steps: |
| 56 | + - name: "Checkout" |
| 57 | + uses: "actions/checkout@v4" |
| 58 | + |
| 59 | + - name: "Setup ruby" |
| 60 | + uses: "ruby/setup-ruby@v1" |
| 61 | + with: |
| 62 | + ruby-version: "3.1" |
| 63 | + bundler-cache: true |
| 64 | + |
| 65 | + - name: Print bundle environment |
| 66 | + run: | |
| 67 | + echo ::group::bundler environment |
| 68 | + bundle env |
| 69 | + echo ::endgroup:: |
| 70 | +
|
| 71 | + - name: Provision test environment |
| 72 | + run: | |
| 73 | + bundle exec rake "litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]" |
| 74 | + # Redact password |
| 75 | + FILE='spec/fixtures/litmus_inventory.yaml' |
| 76 | + sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true |
| 77 | +
|
| 78 | + - name: "Install Puppet agent" |
| 79 | + run: | |
| 80 | + bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' |
| 81 | +
|
| 82 | + - name: "Install module" |
| 83 | + run: | |
| 84 | + bundle exec rake 'litmus:install_module' |
| 85 | +
|
| 86 | + - name: "Run acceptance tests" |
| 87 | + run: | |
| 88 | + bundle exec rake 'litmus:acceptance:parallel' |
| 89 | +
|
| 90 | + - name: "Remove test environment" |
| 91 | + if: ${{ always() }} |
| 92 | + continue-on-error: true |
| 93 | + run: | |
| 94 | + if [[ -f spec/fixtures/litmus_inventory.yaml ]]; then |
| 95 | + bundle exec rake 'litmus:tear_down' |
| 96 | + fi |
0 commit comments