Skip to content

Commit f7e007f

Browse files
committed
chore(workflows): simplify YAML syntax and improve readability
- Removed unnecessary quotes around strings in YAML files. - Consolidated list items to single-line format where applicable. - Ensured consistent naming conventions for job steps. - Improved readability by removing extra blank lines.
1 parent f1af323 commit f7e007f

File tree

2 files changed

+60
-98
lines changed

2 files changed

+60
-98
lines changed

.github/workflows/test-add-compiler-matrix.yml

+34-53
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,58 @@
11
---
2-
name: "Add compiler matrix"
3-
2+
name: Add compiler 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-compiler:
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-
- large
43-
- extra-large
44-
version:
45-
- 2021.7.7
46-
- 2023.6.0
47-
image:
48-
- centos-7
49-
- almalinux-cloud/almalinux-8
38+
architecture: [standard, large, extra-large]
39+
version: [2021.7.7, 2023.6.0]
40+
image: [centos-7, 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"
55+
- name: Provision test cluster
6856
timeout-minutes: 15
6957
run: |
7058
echo ::group::prepare
@@ -74,49 +62,42 @@ 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 }}-with-extra-compiler
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 \
9882
--inventoryfile spec/fixtures/litmus_inventory.yaml \
9983
--modulepath spec/fixtures/modules \
10084
architecture=${{ matrix.architecture }} \
10185
version=${{ matrix.version }}
102-
103-
- name: 'Run add_compiler plan'
86+
- name: Run add_compiler plan
10487
timeout-minutes: 50
10588
run: |
10689
bundle exec bolt plan run peadm_spec::add_compiler -v \
10790
--inventoryfile spec/fixtures/litmus_inventory.yaml \
10891
--modulepath spec/fixtures/modules \
10992
architecture=${{ matrix.architecture }}
110-
111-
- name: 'Tear down test cluster'
93+
- name: Tear down test cluster
11294
if: ${{ always() }}
11395
continue-on-error: true
114-
run: |
96+
run: |-
11597
if [ -f spec/fixtures/litmus_inventory.yaml ]; then
11698
echo ::group::tear_down
11799
bundle exec rake 'litmus:tear_down'
118100
echo ::endgroup::
119-
120101
echo ::group::info:request
121102
cat request.json || true; echo
122103
echo ::endgroup::

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

+26-45
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,59 @@
11
---
2-
name: "Add Compiler test"
3-
2+
name: Add Compiler 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: 'large'
13+
default: large
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
2221
default: 'false'
23-
2422
jobs:
2523
test-add-compiler:
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"
51-
uses: actions/checkout@v4
52-
53-
- name: "Activate Ruby 2.7"
43+
- name: Checkout Source
44+
uses: actions/checkout@v2
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 added compiler)'
56+
- name: Provision test cluster (specified architecture with added compiler)
6757
timeout-minutes: 15
6858
run: |
6959
echo ::group::prepare
@@ -73,60 +63,51 @@ 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 }}-with-extra-compiler
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 \
9783
--inventoryfile spec/fixtures/litmus_inventory.yaml \
9884
--modulepath spec/fixtures/modules \
9985
architecture=${{ matrix.architecture }} \
100-
version=${{ matrix.version }} \
101-
console_password=${{ secrets.CONSOLE_PASSWORD }}
102-
103-
- name: 'Run add_compiler plan'
86+
version=${{ matrix.version }}
87+
- name: Run add_compiler plan
10488
timeout-minutes: 50
10589
run: |
10690
bundle exec bolt plan run peadm_spec::add_compiler -v \
10791
--inventoryfile spec/fixtures/litmus_inventory.yaml \
10892
--modulepath spec/fixtures/modules \
10993
architecture=${{ matrix.architecture }} \
11094
--stream
111-
112-
- 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
11396
if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }}
11497
run: |
11598
while [ -f "${HOME}/pause" ] ; do
11699
echo "${HOME}/pause present, sleeping for 60 seconds..."
117100
sleep 60
118101
done
119102
echo "${HOME}/pause absent, continuing workflow."
120-
121-
- name: 'Tear down test cluster'
103+
- name: Tear down test cluster
122104
if: ${{ always() }}
123105
continue-on-error: true
124-
run: |
106+
run: |-
125107
if [ -f spec/fixtures/litmus_inventory.yaml ]; then
126108
echo ::group::tear_down
127109
bundle exec rake 'litmus:tear_down'
128110
echo ::endgroup::
129-
130111
echo ::group::info:request
131112
cat request.json || true; echo
132113
echo ::endgroup::

0 commit comments

Comments
 (0)