|
| 1 | +--- |
| 2 | +name: "Add replica matrix" |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - ".github/workflows/**/*" |
| 8 | + - "spec/**/*" |
| 9 | + - "lib/**/*" |
| 10 | + - "tasks/**/*" |
| 11 | + - "functions/**/*" |
| 12 | + - "types/**/*" |
| 13 | + - "plans/**/*" |
| 14 | + - "hiera/**/*" |
| 15 | + - "manifests/**/*" |
| 16 | + - "templates/**/*" |
| 17 | + - "files/**/*" |
| 18 | + - "metadata.json" |
| 19 | + - "Rakefile" |
| 20 | + - "Gemfile" |
| 21 | + - "provision.yaml" |
| 22 | + - ".rspec" |
| 23 | + - ".rubocop.yml" |
| 24 | + - ".puppet-lint.rc" |
| 25 | + - ".fixtures.yml" |
| 26 | + branches: [main] |
| 27 | + workflow_dispatch: {} |
| 28 | + |
| 29 | +jobs: |
| 30 | + test-add-replica: |
| 31 | + name: "PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}" |
| 32 | + runs-on: ubuntu-20.04 |
| 33 | + env: |
| 34 | + BOLT_GEM: true |
| 35 | + BOLT_DISABLE_ANALYTICS: true |
| 36 | + LANG: "en_US.UTF-8" |
| 37 | + strategy: |
| 38 | + fail-fast: false |
| 39 | + matrix: |
| 40 | + architecture: |
| 41 | + - standard |
| 42 | + - standard-with-dr |
| 43 | + - large |
| 44 | + - extra-large |
| 45 | + version: |
| 46 | + - 2021.7.7 |
| 47 | + - 2023.6.0 |
| 48 | + image: |
| 49 | + - almalinux-cloud/almalinux-8 |
| 50 | + steps: |
| 51 | + - name: "Checkout Source" |
| 52 | + uses: actions/checkout@v2 |
| 53 | + |
| 54 | + - name: "Activate Ruby 2.7" |
| 55 | + uses: ruby/setup-ruby@v1 |
| 56 | + with: |
| 57 | + ruby-version: "2.7" |
| 58 | + bundler-cache: true |
| 59 | + |
| 60 | + - name: "Print bundle environment" |
| 61 | + if: ${{ github.repository_owner == 'puppetlabs' }} |
| 62 | + run: | |
| 63 | + echo ::group::info:bundler |
| 64 | + bundle env |
| 65 | + echo ::endgroup:: |
| 66 | +
|
| 67 | + - name: 'Provision test cluster (specified architecture and a spare replica)' |
| 68 | + timeout-minutes: 15 |
| 69 | + run: | |
| 70 | + echo ::group::prepare |
| 71 | + mkdir -p $HOME/.ssh |
| 72 | + echo 'Host *' > $HOME/.ssh/config |
| 73 | + echo ' ServerAliveInterval 150' >> $HOME/.ssh/config |
| 74 | + echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config |
| 75 | + bundle exec rake spec_prep |
| 76 | + echo ::endgroup:: |
| 77 | +
|
| 78 | + echo ::group::provision |
| 79 | + bundle exec bolt plan run peadm_spec::provision_test_cluster \ |
| 80 | + --modulepath spec/fixtures/modules \ |
| 81 | + provider=provision_service \ |
| 82 | + image=${{ matrix.image }} \ |
| 83 | + architecture=${{ matrix.architecture }}-and-spare-replica |
| 84 | + echo ::endgroup:: |
| 85 | +
|
| 86 | + echo ::group::info:request |
| 87 | + cat request.json || true; echo |
| 88 | + echo ::endgroup:: |
| 89 | +
|
| 90 | + echo ::group::info:inventory |
| 91 | + sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true |
| 92 | + echo ::endgroup:: |
| 93 | +
|
| 94 | + - name: "Install PE on test cluster" |
| 95 | + timeout-minutes: 120 |
| 96 | + run: | |
| 97 | + bundle exec bolt plan run peadm_spec::install_test_cluster \ |
| 98 | + --inventoryfile spec/fixtures/litmus_inventory.yaml \ |
| 99 | + --modulepath spec/fixtures/modules \ |
| 100 | + architecture=${{ matrix.architecture }} \ |
| 101 | + version=${{ matrix.version }} \ |
| 102 | + code_manager_auto_configure=true |
| 103 | +
|
| 104 | + - name: 'Run add_replica plan' |
| 105 | + timeout-minutes: 60 |
| 106 | + run: | |
| 107 | + bundle exec bolt plan run peadm_spec::add_replica -v \ |
| 108 | + --inventoryfile spec/fixtures/litmus_inventory.yaml \ |
| 109 | + --modulepath spec/fixtures/modules \ |
| 110 | + --stream |
| 111 | +
|
| 112 | + - name: 'Tear down test cluster' |
| 113 | + if: ${{ always() }} |
| 114 | + continue-on-error: true |
| 115 | + run: | |
| 116 | + if [ -f spec/fixtures/litmus_inventory.yaml ]; then |
| 117 | + echo ::group::tear_down |
| 118 | + bundle exec rake 'litmus:tear_down' |
| 119 | + echo ::endgroup:: |
| 120 | +
|
| 121 | + echo ::group::info:request |
| 122 | + cat request.json || true; echo |
| 123 | + echo ::endgroup:: |
| 124 | + fi |
0 commit comments