Skip to content

Commit

Permalink
chore: update test-add-replica workflow
Browse files Browse the repository at this point in the history
- Remove unnecessary quotes from YAML keys and values
- Standardize single quotes for string values
- Improve readability by removing extra blank lines
  • Loading branch information
CoMfUcIoS committed Sep 2, 2024
1 parent eeb3233 commit e353042
Showing 1 changed file with 25 additions and 43 deletions.
68 changes: 25 additions & 43 deletions .github/workflows/test-add-replica.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -73,24 +63,20 @@ 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 \
provider=provision_service \
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 \
Expand All @@ -99,33 +85,29 @@ 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
echo "${HOME}/pause present, sleeping for 60 seconds..."
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::
Expand Down

0 comments on commit e353042

Please sign in to comment.