diff --git a/.github/workflows/test-add-replica.yaml b/.github/workflows/test-add-replica.yaml index 6e92e0c3..217f1b1d 100644 --- a/.github/workflows/test-add-replica.yaml +++ b/.github/workflows/test-add-replica.yaml @@ -1,69 +1,59 @@ --- -name: "Add Replica test" - +name: Add Replica test on: workflow_dispatch: inputs: image: - description: "GCP image for test cluster" + description: GCP image for test cluster required: true - default: "almalinux-cloud/almalinux-8" + default: almalinux-cloud/almalinux-8 architecture: - description: "PE architecture to test" + description: PE architecture to test required: true - default: "standard" + default: standard version: - description: "PE version to install" + description: PE version to install required: true - default: "2021.7.8" + default: 2021.7.8 ssh-debugging: - description: "Boolean; whether or not to pause for ssh debugging" + description: Boolean; whether or not to pause for ssh debugging required: true - default: "false" - + default: 'false' jobs: test-add-replica: - name: "PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}" + name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} runs-on: ubuntu-20.04 env: BOLT_GEM: true BOLT_DISABLE_ANALYTICS: true - LANG: "en_US.UTF-8" + LANG: en_US.UTF-8 strategy: fail-fast: false matrix: - architecture: - - "${{ github.event.inputs.architecture }}" - version: - - "${{ github.event.inputs.version }}" - image: - - "${{ github.event.inputs.image }}" - + architecture: ['${{ github.event.inputs.architecture }}'] + version: ['${{ github.event.inputs.version }}'] + image: ['${{ github.event.inputs.image }}'] steps: - - name: "Start SSH session" + - name: Start SSH session if: ${{ github.event.inputs.ssh-debugging == 'true' }} uses: luchihoratiu/debug-via-ssh@main with: NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} SSH_PASS: ${{ secrets.SSH_PASS }} - - - name: "Checkout Source" + - name: Checkout Source uses: actions/checkout@v4 - - - name: "Activate Ruby 2.7" + - name: Activate Ruby 2.7 uses: ruby/setup-ruby@v1 with: - ruby-version: "2.7" + ruby-version: '2.7' bundler-cache: true - - - name: "Print bundle environment" + - name: Print bundle environment if: ${{ github.repository_owner == 'puppetlabs' }} run: | echo ::group::info:bundler bundle env echo ::endgroup:: - - - name: "Provision test cluster (specified architecture with spare replica)" + - name: Provision test cluster (specified architecture with spare replica) timeout-minutes: 15 run: | echo ::group::prepare @@ -73,7 +63,6 @@ jobs: echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config bundle exec rake spec_prep echo ::endgroup:: - echo ::group::provision bundle exec bolt plan run peadm_spec::provision_test_cluster \ --modulepath spec/fixtures/modules \ @@ -81,16 +70,13 @@ jobs: image=${{ matrix.image }} \ architecture=${{ matrix.architecture }}-and-spare-replica echo ::endgroup:: - echo ::group::info:request cat request.json || true; echo echo ::endgroup:: - echo ::group::info:inventory sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true echo ::endgroup:: - - - name: "Install PE on test cluster" + - name: Install PE on test cluster timeout-minutes: 120 run: | bundle exec bolt plan run peadm_spec::install_test_cluster \ @@ -99,16 +85,14 @@ jobs: architecture=${{ matrix.architecture }} \ version=${{ matrix.version }} \ console_password=${{ secrets.CONSOLE_PASSWORD }} - - - name: "Run add_replica plan" + - name: Run add_replica plan timeout-minutes: 60 run: | bundle exec bolt plan run peadm_spec::add_replica -v \ --inventoryfile spec/fixtures/litmus_inventory.yaml \ --modulepath spec/fixtures/modules \ --stream - - - name: "Wait as long as the file ${HOME}/pause file is present" + - name: Wait as long as the file ${HOME}/pause file is present if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} run: | while [ -f "${HOME}/pause" ] ; do @@ -116,16 +100,14 @@ jobs: sleep 60 done echo "${HOME}/pause absent, continuing workflow." - - - name: "Tear down test cluster" + - name: Tear down test cluster if: ${{ always() }} continue-on-error: true - run: | + run: |- if [ -f spec/fixtures/litmus_inventory.yaml ]; then echo ::group::tear_down bundle exec rake 'litmus:tear_down' echo ::endgroup:: - echo ::group::info:request cat request.json || true; echo echo ::endgroup::