Skip to content

Commit 5598d09

Browse files
committed
chore: update test-add-replica workflow
- Remove unnecessary quotes from YAML keys and values - Standardize single quotes for string values - Improve readability by removing extra blank lines
1 parent eeb3233 commit 5598d09

File tree

2 files changed

+59
-96
lines changed

2 files changed

+59
-96
lines changed

.github/workflows/test-add-replica-matrix.yaml

+34-53
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,58 @@
11
---
2-
name: "Add replica matrix"
3-
2+
name: Add replica matrix
43
on:
54
pull_request:
65
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"
6+
- .github/workflows/**/*
7+
- spec/**/*
8+
- lib/**/*
9+
- tasks/**/*
10+
- functions/**/*
11+
- types/**/*
12+
- plans/**/*
13+
- hiera/**/*
14+
- manifests/**/*
15+
- templates/**/*
16+
- files/**/*
17+
- metadata.json
18+
- Rakefile
19+
- Gemfile
20+
- provision.yaml
21+
- .rspec
22+
- .rubocop.yml
23+
- .puppet-lint.rc
24+
- .fixtures.yml
2625
branches: [main]
2726
workflow_dispatch: {}
28-
2927
jobs:
3028
test-add-replica:
31-
name: "PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}"
29+
name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}
3230
runs-on: ubuntu-20.04
3331
env:
3432
BOLT_GEM: true
3533
BOLT_DISABLE_ANALYTICS: true
36-
LANG: "en_US.UTF-8"
34+
LANG: en_US.UTF-8
3735
strategy:
3836
fail-fast: false
3937
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
38+
architecture: [standard, standard-with-dr, large, extra-large]
39+
version: [2021.7.7, 2023.6.0]
40+
image: [almalinux-cloud/almalinux-8]
5041
steps:
51-
- name: "Checkout Source"
42+
- name: Checkout Source
5243
uses: actions/checkout@v2
53-
54-
- name: "Activate Ruby 2.7"
44+
- name: Activate Ruby 2.7
5545
uses: ruby/setup-ruby@v1
5646
with:
57-
ruby-version: "2.7"
47+
ruby-version: '2.7'
5848
bundler-cache: true
59-
60-
- name: "Print bundle environment"
49+
- name: Print bundle environment
6150
if: ${{ github.repository_owner == 'puppetlabs' }}
6251
run: |
6352
echo ::group::info:bundler
6453
bundle env
6554
echo ::endgroup::
66-
67-
- name: 'Provision test cluster (specified architecture and a spare replica)'
55+
- name: Provision test cluster (specified architecture and a spare replica)
6856
timeout-minutes: 15
6957
run: |
7058
echo ::group::prepare
@@ -74,24 +62,20 @@ jobs:
7462
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
7563
bundle exec rake spec_prep
7664
echo ::endgroup::
77-
7865
echo ::group::provision
7966
bundle exec bolt plan run peadm_spec::provision_test_cluster \
8067
--modulepath spec/fixtures/modules \
8168
provider=provision_service \
8269
image=${{ matrix.image }} \
8370
architecture=${{ matrix.architecture }}-and-spare-replica
8471
echo ::endgroup::
85-
8672
echo ::group::info:request
8773
cat request.json || true; echo
8874
echo ::endgroup::
89-
9075
echo ::group::info:inventory
9176
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
9277
echo ::endgroup::
93-
94-
- name: "Install PE on test cluster"
78+
- name: Install PE on test cluster
9579
timeout-minutes: 120
9680
run: |
9781
bundle exec bolt plan run peadm_spec::install_test_cluster \
@@ -100,24 +84,21 @@ jobs:
10084
architecture=${{ matrix.architecture }} \
10185
version=${{ matrix.version }} \
10286
code_manager_auto_configure=true
103-
104-
- name: 'Run add_replica plan'
87+
- name: Run add_replica plan
10588
timeout-minutes: 60
10689
run: |
10790
bundle exec bolt plan run peadm_spec::add_replica -v \
10891
--inventoryfile spec/fixtures/litmus_inventory.yaml \
10992
--modulepath spec/fixtures/modules \
11093
--stream
111-
112-
- name: 'Tear down test cluster'
94+
- name: Tear down test cluster
11395
if: ${{ always() }}
11496
continue-on-error: true
115-
run: |
97+
run: |-
11698
if [ -f spec/fixtures/litmus_inventory.yaml ]; then
11799
echo ::group::tear_down
118100
bundle exec rake 'litmus:tear_down'
119101
echo ::endgroup::
120-
121102
echo ::group::info:request
122103
cat request.json || true; echo
123104
echo ::endgroup::

.github/workflows/test-add-replica.yaml

+25-43
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,59 @@
11
---
2-
name: "Add Replica test"
3-
2+
name: Add Replica test
43
on:
54
workflow_dispatch:
65
inputs:
76
image:
8-
description: "GCP image for test cluster"
7+
description: GCP image for test cluster
98
required: true
10-
default: "almalinux-cloud/almalinux-8"
9+
default: almalinux-cloud/almalinux-8
1110
architecture:
12-
description: "PE architecture to test"
11+
description: PE architecture to test
1312
required: true
14-
default: "standard"
13+
default: standard
1514
version:
16-
description: "PE version to install"
15+
description: PE version to install
1716
required: true
18-
default: "2021.7.8"
17+
default: 2021.7.8
1918
ssh-debugging:
20-
description: "Boolean; whether or not to pause for ssh debugging"
19+
description: Boolean; whether or not to pause for ssh debugging
2120
required: true
22-
default: "false"
23-
21+
default: 'false'
2422
jobs:
2523
test-add-replica:
26-
name: "PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}"
24+
name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }}
2725
runs-on: ubuntu-20.04
2826
env:
2927
BOLT_GEM: true
3028
BOLT_DISABLE_ANALYTICS: true
31-
LANG: "en_US.UTF-8"
29+
LANG: en_US.UTF-8
3230
strategy:
3331
fail-fast: false
3432
matrix:
35-
architecture:
36-
- "${{ github.event.inputs.architecture }}"
37-
version:
38-
- "${{ github.event.inputs.version }}"
39-
image:
40-
- "${{ github.event.inputs.image }}"
41-
33+
architecture: ['${{ github.event.inputs.architecture }}']
34+
version: ['${{ github.event.inputs.version }}']
35+
image: ['${{ github.event.inputs.image }}']
4236
steps:
43-
- name: "Start SSH session"
37+
- name: Start SSH session
4438
if: ${{ github.event.inputs.ssh-debugging == 'true' }}
4539
uses: luchihoratiu/debug-via-ssh@main
4640
with:
4741
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
4842
SSH_PASS: ${{ secrets.SSH_PASS }}
49-
50-
- name: "Checkout Source"
43+
- name: Checkout Source
5144
uses: actions/checkout@v4
52-
53-
- name: "Activate Ruby 2.7"
45+
- name: Activate Ruby 2.7
5446
uses: ruby/setup-ruby@v1
5547
with:
56-
ruby-version: "2.7"
48+
ruby-version: '2.7'
5749
bundler-cache: true
58-
59-
- name: "Print bundle environment"
50+
- name: Print bundle environment
6051
if: ${{ github.repository_owner == 'puppetlabs' }}
6152
run: |
6253
echo ::group::info:bundler
6354
bundle env
6455
echo ::endgroup::
65-
66-
- name: "Provision test cluster (specified architecture with spare replica)"
56+
- name: Provision test cluster (specified architecture with spare replica)
6757
timeout-minutes: 15
6858
run: |
6959
echo ::group::prepare
@@ -73,24 +63,20 @@ jobs:
7363
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
7464
bundle exec rake spec_prep
7565
echo ::endgroup::
76-
7766
echo ::group::provision
7867
bundle exec bolt plan run peadm_spec::provision_test_cluster \
7968
--modulepath spec/fixtures/modules \
8069
provider=provision_service \
8170
image=${{ matrix.image }} \
8271
architecture=${{ matrix.architecture }}-and-spare-replica
8372
echo ::endgroup::
84-
8573
echo ::group::info:request
8674
cat request.json || true; echo
8775
echo ::endgroup::
88-
8976
echo ::group::info:inventory
9077
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
9178
echo ::endgroup::
92-
93-
- name: "Install PE on test cluster"
79+
- name: Install PE on test cluster
9480
timeout-minutes: 120
9581
run: |
9682
bundle exec bolt plan run peadm_spec::install_test_cluster \
@@ -99,33 +85,29 @@ jobs:
9985
architecture=${{ matrix.architecture }} \
10086
version=${{ matrix.version }} \
10187
console_password=${{ secrets.CONSOLE_PASSWORD }}
102-
103-
- name: "Run add_replica plan"
88+
- name: Run add_replica plan
10489
timeout-minutes: 60
10590
run: |
10691
bundle exec bolt plan run peadm_spec::add_replica -v \
10792
--inventoryfile spec/fixtures/litmus_inventory.yaml \
10893
--modulepath spec/fixtures/modules \
10994
--stream
110-
111-
- name: "Wait as long as the file ${HOME}/pause file is present"
95+
- name: Wait as long as the file ${HOME}/pause file is present
11296
if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }}
11397
run: |
11498
while [ -f "${HOME}/pause" ] ; do
11599
echo "${HOME}/pause present, sleeping for 60 seconds..."
116100
sleep 60
117101
done
118102
echo "${HOME}/pause absent, continuing workflow."
119-
120-
- name: "Tear down test cluster"
103+
- name: Tear down test cluster
121104
if: ${{ always() }}
122105
continue-on-error: true
123-
run: |
106+
run: |-
124107
if [ -f spec/fixtures/litmus_inventory.yaml ]; then
125108
echo ::group::tear_down
126109
bundle exec rake 'litmus:tear_down'
127110
echo ::endgroup::
128-
129111
echo ::group::info:request
130112
cat request.json || true; echo
131113
echo ::endgroup::

0 commit comments

Comments
 (0)