Skip to content

Commit dc58316

Browse files
authored
Merge pull request #386 from puppetlabs/pdksync_pdksync_heads/main-0-gf3911d3
pdksync - pdksync_heads/main-0-gf3911d3
2 parents d3e2b33 + fdfabf9 commit dc58316

File tree

10 files changed

+87
-54
lines changed

10 files changed

+87
-54
lines changed

.devcontainer/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# devcontainer
2+
3+
4+
For format details, see https://aka.ms/devcontainer.json.
5+
6+
For config options, see the README at:
7+
https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
8+
9+
``` json
10+
{
11+
"name": "Puppet Development Kit (Community)",
12+
"dockerFile": "Dockerfile",
13+
14+
// Set *default* container specific settings.json values on container create.
15+
"settings": {
16+
"terminal.integrated.shell.linux": "/bin/bash"
17+
},
18+
19+
// Add the IDs of extensions you want installed when the container is created.
20+
"extensions": [
21+
"puppet.puppet-vscode",
22+
"rebornix.Ruby"
23+
]
24+
25+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26+
"forwardPorts": [],
27+
28+
// Use 'postCreateCommand' to run commands after the container is created.
29+
"postCreateCommand": "pdk --version",
30+
}
31+
```
32+
33+
34+

.devcontainer/devcontainer.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
31
{
42
"name": "Puppet Development Kit (Community)",
53
"dockerFile": "Dockerfile",
64

7-
// Set *default* container specific settings.json values on container create.
85
"settings": {
9-
"terminal.integrated.shell.linux": "/bin/bash"
6+
"terminal.integrated.profiles.linux": {
7+
"bash": {
8+
"path": "bash",
9+
}
10+
}
1011
},
1112

12-
// Add the IDs of extensions you want installed when the container is created.
1313
"extensions": [
1414
"puppet.puppet-vscode",
1515
"rebornix.Ruby"
1616
]
17-
18-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19-
// "forwardPorts": [],
20-
21-
// Use 'postCreateCommand' to run commands after the container is created.
22-
// "postCreateCommand": "pdk --version",
2317
}

.github/workflows/auto_release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55

66
env:
7-
HONEYCOMB_WRITEKEY: {{ secrets.HONEYCOMB_WRITEKEY }}
7+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
88
HONEYCOMB_DATASET: litmus tests
99
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1010

@@ -14,6 +14,7 @@ jobs:
1414
runs-on: ubuntu-20.04
1515

1616
steps:
17+
1718
- name: "Honeycomb: Start recording"
1819
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
1920
with:
@@ -25,7 +26,6 @@ jobs:
2526
run: |
2627
echo STEP_ID="auto-release" >> $GITHUB_ENV
2728
echo STEP_START=$(date +%s) >> $GITHUB_ENV
28-
2929
- name: "Checkout Source"
3030
if: ${{ github.repository_owner == 'puppetlabs' }}
3131
uses: actions/checkout@v2
@@ -46,8 +46,14 @@ jobs:
4646
run: |
4747
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
4848
49-
- name: "Commit changes"
49+
- name: "Check if a release is necessary"
5050
if: ${{ github.repository_owner == 'puppetlabs' }}
51+
id: check
52+
run: |
53+
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
54+
55+
- name: "Commit changes"
56+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
5157
run: |
5258
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
5359
git config --local user.name "GitHub Action"
@@ -57,7 +63,7 @@ jobs:
5763
- name: Create Pull Request
5864
id: cpr
5965
uses: puppetlabs/peter-evans-create-pull-request@v3
60-
if: ${{ github.repository_owner == 'puppetlabs' }}
66+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
6167
with:
6268
token: ${{ secrets.GITHUB_TOKEN }}
6369
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
@@ -73,11 +79,11 @@ jobs:
7379
labels: "maintenance"
7480

7581
- name: PR outputs
76-
if: ${{ github.repository_owner == 'puppetlabs' }}
82+
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
7783
run: |
7884
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
7985
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
80-
86+
8187
- name: "Honeycomb: Record finish step"
8288
if: ${{ always() }}
8389
run: |

.github/workflows/nightly.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ on:
44
schedule:
55
- cron: '0 0 * * *'
66

7+
78
env:
8-
HONEYCOMB_WRITEKEY: {{ secrets.HONEYCOMB_WRITEKEY }}
9+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
910
HONEYCOMB_DATASET: litmus tests
1011

1112
jobs:
1213
setup_matrix:
14+
if: ${{ github.repository_owner == 'puppetlabs' }}
1315
name: "Setup Test Matrix"
1416
runs-on: ubuntu-20.04
1517
outputs:
1618
matrix: ${{ steps.get-matrix.outputs.matrix }}
1719

1820
steps:
21+
1922
- name: "Honeycomb: Start recording"
2023
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
2124
with:
@@ -27,7 +30,6 @@ jobs:
2730
run: |
2831
echo STEP_ID=setup-environment >> $GITHUB_ENV
2932
echo STEP_START=$(date +%s) >> $GITHUB_ENV
30-
3133
- name: Checkout Source
3234
uses: actions/checkout@v2
3335
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -45,29 +47,27 @@ jobs:
4547
echo ::group::bundler environment
4648
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
4749
echo ::endgroup::
48-
50+
4951
- name: "Honeycomb: Record Setup Environment time"
5052
if: ${{ github.repository_owner == 'puppetlabs' }}
5153
run: |
5254
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
5355
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
5456
echo STEP_START=$(date +%s) >> $GITHUB_ENV
55-
5657
- name: Setup Acceptance Test Matrix
5758
id: get-matrix
5859
if: ${{ github.repository_owner == 'puppetlabs' }}
5960
run: |
6061
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
61-
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
62+
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
6263
else
6364
echo "::set-output name=matrix::{}"
6465
fi
65-
66+
6667
- name: "Honeycomb: Record Setup Test Matrix time"
6768
if: ${{ always() }}
6869
run: |
6970
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
70-
7171
Acceptance:
7272
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
7373
needs:
@@ -187,7 +187,7 @@ jobs:
187187
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
188188
189189
slack-workflow-status:
190-
if: always()
190+
if: ${{ github.repository_owner == 'puppetlabs' }}
191191
name: Post Workflow Status To Slack
192192
needs:
193193
- Acceptance

.github/workflows/pr_test.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: "PR Testing"
22

33
on: [pull_request]
44

5+
56
env:
6-
HONEYCOMB_WRITEKEY: ${{ secrets.HONEYCOMB_WRITEKEY }}
7+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
78
HONEYCOMB_DATASET: litmus tests
89

910
jobs:
@@ -14,6 +15,7 @@ jobs:
1415
matrix: ${{ steps.get-matrix.outputs.matrix }}
1516

1617
steps:
18+
1719
- name: "Honeycomb: Start recording"
1820
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
1921
with:
@@ -25,7 +27,6 @@ jobs:
2527
run: |
2628
echo STEP_ID=setup-environment >> $GITHUB_ENV
2729
echo STEP_START=$(date +%s) >> $GITHUB_ENV
28-
2930
- name: Checkout Source
3031
uses: actions/checkout@v2
3132
if: ${{ github.repository_owner == 'puppetlabs' }}
@@ -43,28 +44,31 @@ jobs:
4344
echo ::group::bundler environment
4445
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
4546
echo ::endgroup::
46-
47+
4748
- name: "Honeycomb: Record Setup Environment time"
4849
if: ${{ github.repository_owner == 'puppetlabs' }}
4950
run: |
5051
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
5152
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
5253
echo STEP_START=$(date +%s) >> $GITHUB_ENV
54+
- name: Run validation steps
55+
run: |
56+
bundle exec rake validate
57+
if: ${{ github.repository_owner == 'puppetlabs' }}
5358

5459
- name: Setup Acceptance Test Matrix
5560
id: get-matrix
5661
run: |
5762
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
58-
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
63+
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
5964
else
6065
echo "::set-output name=matrix::{}"
6166
fi
62-
67+
6368
- name: "Honeycomb: Record Setup Test Matrix time"
6469
if: ${{ always() }}
6570
run: |
6671
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
67-
6872
Acceptance:
6973
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
7074
needs:
@@ -84,7 +88,7 @@ jobs:
8488
echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
8589
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
8690
echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
87-
91+
8892
- name: "Honeycomb: Start recording"
8993
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
9094
with:
@@ -97,7 +101,6 @@ jobs:
97101
run: |
98102
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
99103
echo STEP_START=$(date +%s) >> $GITHUB_ENV
100-
101104
- name: Checkout Source
102105
uses: actions/checkout@v2
103106

@@ -112,14 +115,13 @@ jobs:
112115
echo ::group::bundler environment
113116
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
114117
echo ::endgroup::
115-
118+
116119
- name: "Honeycomb: Record Setup Environment time"
117120
if: ${{ always() }}
118121
run: |
119122
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
120123
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
121124
echo STEP_START=$(date +%s) >> $GITHUB_ENV
122-
123125
- name: Provision test environment
124126
run: |
125127
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
@@ -145,7 +147,7 @@ jobs:
145147
- name: Install module
146148
run: |
147149
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
148-
150+
149151
- name: "Honeycomb: Record deployment times"
150152
if: ${{ always() }}
151153
run: |
@@ -154,18 +156,16 @@ jobs:
154156
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
155157
echo STEP_START=$(date +%s) >> $GITHUB_ENV
156158
echo ::endgroup::
157-
158159
- name: Run acceptance tests
159160
run: |
160161
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
161-
162+
162163
- name: "Honeycomb: Record acceptance testing times"
163164
if: ${{ always() }}
164165
run: |
165166
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
166167
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
167168
echo STEP_START=$(date +%s) >> $GITHUB_ENV
168-
169169
- name: Remove test environment
170170
if: ${{ always() }}
171171
continue-on-error: true
@@ -177,7 +177,7 @@ jobs:
177177
echo
178178
echo ::endgroup::
179179
fi
180-
180+
181181
- name: "Honeycomb: Record removal times"
182182
if: ${{ always() }}
183183
run: |

0 commit comments

Comments
 (0)