Skip to content

Commit 90a8e91

Browse files
Merge pull request #2139 from puppetlabs/pdksync_pdkupdate
pdksync - PDK Update - Replace Travis and Appveyor with Github Actions
2 parents c007169 + 7f26435 commit 90a8e91

File tree

9 files changed

+208
-83
lines changed

9 files changed

+208
-83
lines changed

.github/workflows/auto_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
persist-credentials: false
3737

3838
- name: "PDK Release prep"
39-
uses: docker://puppet/pdk:nightly
39+
uses: docker://puppet/iac_release:ci
4040
with:
4141
args: 'release prep --force'
4242
env:
@@ -66,7 +66,7 @@ jobs:
6666
branch: "release-prep"
6767
delete-branch: true
6868
title: "Release prep v${{ steps.gv.outputs.ver }}"
69-
body: "Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb)"
69+
body: "Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}"
7070
labels: "maintenance"
7171

7272
- name: PR outputs

.github/workflows/nightly.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,14 @@ jobs:
131131
echo
132132
echo ::endgroup::
133133
echo ::group::=== INVENTORY ===
134-
sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
134+
if [ -f 'spec/fixtures/litmus_inventory.yaml' ];
135+
then
136+
FILE='spec/fixtures/litmus_inventory.yaml'
137+
elif [ -f 'inventory.yaml' ];
138+
then
139+
FILE='inventory.yaml'
140+
fi
141+
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
135142
echo ::endgroup::
136143
137144
- name: Install agent
@@ -166,7 +173,7 @@ jobs:
166173
if: ${{ always() }}
167174
continue-on-error: true
168175
run: |
169-
if [ -f inventory.yaml ]; then
176+
if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
170177
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
171178
echo ::group::=== REQUEST ===
172179
cat request.json || true

.github/workflows/pr_test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,14 @@ jobs:
128128
echo
129129
echo ::endgroup::
130130
echo ::group::=== INVENTORY ===
131-
sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
131+
if [ -f 'spec/fixtures/litmus_inventory.yaml' ];
132+
then
133+
FILE='spec/fixtures/litmus_inventory.yaml'
134+
elif [ -f 'inventory.yaml' ];
135+
then
136+
FILE='inventory.yaml'
137+
fi
138+
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
132139
echo ::endgroup::
133140
134141
- name: Install agent
@@ -163,7 +170,7 @@ jobs:
163170
if: ${{ always() }}
164171
continue-on-error: true
165172
run: |
166-
if [ -f inventory.yaml ]; then
173+
if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
167174
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
168175
echo ::group::=== REQUEST ===
169176
cat request.json || true

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: "Publish module"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
create-github-release:
8+
name: Deploy GitHub Release
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
with:
14+
ref: ${{ github.ref }}
15+
clean: true
16+
fetch-depth: 0
17+
- name: Get Version
18+
id: gv
19+
run: |
20+
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
21+
- name: Create Release
22+
uses: actions/create-release@v1
23+
id: create_release
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
tag_name: "v${{ steps.gv.outputs.ver }}"
28+
draft: false
29+
prerelease: false
30+
31+
deploy-forge:
32+
name: Deploy to Forge
33+
runs-on: ubuntu-20.04
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
with:
38+
ref: ${{ github.ref }}
39+
clean: true
40+
- name: "PDK Build"
41+
uses: docker://puppet/pdk:nightly
42+
with:
43+
args: 'build'
44+
- name: "Push to Forge"
45+
uses: docker://puppet/pdk:nightly
46+
with:
47+
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'

.github/workflows/spec.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: "Spec Tests"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
pull_request:
8+
9+
env:
10+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
11+
HONEYCOMB_DATASET: litmus tests
12+
13+
jobs:
14+
setup_matrix:
15+
name: "Setup Test Matrix"
16+
runs-on: ubuntu-20.04
17+
outputs:
18+
spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }}
19+
20+
steps:
21+
- name: "Honeycomb: Start recording"
22+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
23+
with:
24+
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
25+
dataset: ${{ env.HONEYCOMB_DATASET }}
26+
job-status: ${{ job.status }}
27+
28+
- name: "Honeycomb: Start first step"
29+
run: |
30+
echo STEP_ID=setup-environment >> $GITHUB_ENV
31+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
32+
33+
- name: Checkout Source
34+
uses: actions/checkout@v2
35+
if: ${{ github.repository_owner == 'puppetlabs' }}
36+
37+
- name: Activate Ruby 2.7
38+
uses: ruby/setup-ruby@v1
39+
if: ${{ github.repository_owner == 'puppetlabs' }}
40+
with:
41+
ruby-version: "2.7"
42+
bundler-cache: true
43+
44+
- name: Print bundle environment
45+
if: ${{ github.repository_owner == 'puppetlabs' }}
46+
run: |
47+
echo ::group::bundler environment
48+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
49+
echo ::endgroup::
50+
51+
- name: "Honeycomb: Record Setup Environment time"
52+
if: ${{ github.repository_owner == 'puppetlabs' }}
53+
run: |
54+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
55+
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
56+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
57+
58+
- name: Setup Acceptance Test Matrix
59+
id: get-matrix
60+
run: |
61+
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
62+
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
63+
else
64+
echo "::set-output name=spec_matrix::{}"
65+
fi
66+
67+
- name: "Honeycomb: Record Setup Test Matrix time"
68+
if: ${{ always() }}
69+
run: |
70+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
71+
72+
Spec:
73+
name: "Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})"
74+
needs:
75+
- setup_matrix
76+
if: ${{ needs.setup_matrix.outputs.spec_matrix != '{}' }}
77+
78+
runs-on: ubuntu-20.04
79+
strategy:
80+
fail-fast: false
81+
matrix: ${{fromJson(needs.setup_matrix.outputs.spec_matrix)}}
82+
83+
env:
84+
BUILDEVENT_FILE: '../buildevents.txt'
85+
PUPPET_GEM_VERSION: ${{ matrix.puppet_version }}
86+
87+
steps:
88+
- run: |
89+
echo "SANITIZED_PUPPET_VERSION=$(echo '${{ matrix.puppet_version }}' | sed 's/~> //g')" >> $GITHUB_ENV
90+
91+
- run: |
92+
echo 'puppet_version=${{ env.SANITIZED_PUPPET_VERSION }}' >> $BUILDEVENT_FILE
93+
94+
- name: "Honeycomb: Start first step"
95+
run: |
96+
echo "STEP_ID=${{ env.SANITIZED_PUPPET_VERSION }}-spec" >> $GITHUB_ENV
97+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
98+
99+
- name: "Honeycomb: Start recording"
100+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
101+
with:
102+
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
103+
dataset: ${{ env.HONEYCOMB_DATASET }}
104+
job-status: ${{ job.status }}
105+
matrix-key: ${{ env.SANITIZED_PUPPET_VERSION }}
106+
107+
- name: Checkout Source
108+
uses: actions/checkout@v2
109+
110+
- name: "Activate Ruby ${{ matrix.ruby_version }}"
111+
uses: ruby/setup-ruby@v1
112+
with:
113+
ruby-version: ${{matrix.ruby_version}}
114+
bundler-cache: true
115+
116+
- name: Print bundle environment
117+
run: |
118+
echo ::group::bundler environment
119+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
120+
echo ::endgroup::
121+
122+
- name: Run parallel_spec tests
123+
run: |
124+
buildevents cmd $TRACE_ID $STEP_ID 'rake parallel_spec Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake parallel_spec

.pdkignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@
4242
/spec/
4343
/.vscode/
4444
/.sync.yml
45+
/.devcontainer/

.sync.yml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,9 @@
33
delete: true
44
".rubocop.yml":
55
include_todos: true
6-
".travis.yml":
7-
global_env:
8-
- HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests"
9-
deploy_to_forge:
10-
enabled: false
11-
secure: ''
12-
branches:
13-
- release
14-
use_litmus: true
15-
litmus:
16-
provision_list:
17-
- ---travis_el
18-
- travis_deb
19-
- travis_el7
20-
- travis_el8
21-
complex:
22-
- collection:
23-
puppet_collection:
24-
- puppet6
25-
provision_list:
26-
- travis_ub_6
27-
simplecov: true
28-
notifications:
29-
slack:
30-
secure: MrXQwGIUO7WNmLbe7iiWgURiZPUgyvDLkKe3d9S58ohE6gdN6pqlsjP8YgodK8JmIBV1zp5Wj/0cXUmY3xvCtnDmII0DCEk2Y1Cs/W1drKZtS/0BsUpJkj0rDP2fSlKsY5ifESdEta/y8+NkjRnqadbl7SQPYeek4IjAfxjjuig=
316
appveyor.yml:
327
delete: true
8+
339
Gemfile:
3410
optional:
3511
":development":
@@ -50,3 +26,10 @@ spec/spec_helper.rb:
5026
Rakefile:
5127
extras:
5228
"FastGettext.default_text_domain = 'default-text-domain'"
29+
.github/workflows/spec.yml:
30+
checks: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
31+
unmanaged: false
32+
.github/workflows/release.yml:
33+
unmanaged: false
34+
.travis.yml:
35+
delete: true

.travis.yml

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,77 +13,33 @@ before_install:
1313
- gem --version
1414
- bundle -v
1515
script:
16-
- 'SIMPLECOV=yes bundle exec rake $CHECK'
16+
- 'bundle exec rake $CHECK'
1717
bundler_args: --without system_tests
1818
rvm:
1919
- 2.5.7
20-
env:
21-
global:
22-
- HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests"
2320
stages:
2421
- static
2522
- spec
2623
- acceptance
24+
-
25+
if: tag =~ ^v\d
26+
name: deploy
2727
jobs:
2828
fast_finish: true
2929
include:
30-
- before_script:
31-
- "bundle exec rake 'litmus:provision_list[travis_ub_6]'"
32-
- "bundle exec rake 'litmus:install_agent[puppet6]'"
33-
- "bundle exec rake litmus:install_module"
34-
env:
35-
PLATFORMS: travis_ub_6_puppet6
36-
BUNDLE_WITH: system_tests
37-
rvm: 2.5.7
38-
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
39-
services: docker
40-
stage: acceptance
41-
- before_script:
42-
- "bundle exec rake 'litmus:provision_list[travis_deb]'"
43-
- "bundle exec rake 'litmus:install_agent[puppet6]'"
44-
- "bundle exec rake litmus:install_module"
45-
env:
46-
PLATFORMS: travis_deb_puppet6
47-
BUNDLE_WITH: system_tests
48-
rvm: 2.5.7
49-
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
50-
services: docker
51-
stage: acceptance
52-
- before_script:
53-
- "bundle exec rake 'litmus:provision_list[travis_el7]'"
54-
- "bundle exec rake 'litmus:install_agent[puppet6]'"
55-
- "bundle exec rake litmus:install_module"
56-
env:
57-
PLATFORMS: travis_el7_puppet6
58-
BUNDLE_WITH: system_tests
59-
rvm: 2.5.7
60-
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
61-
services: docker
62-
stage: acceptance
63-
- before_script:
64-
- "bundle exec rake 'litmus:provision_list[travis_el8]'"
65-
- "bundle exec rake 'litmus:install_agent[puppet6]'"
66-
- "bundle exec rake litmus:install_module"
67-
env:
68-
PLATFORMS: travis_el8_puppet6
69-
BUNDLE_WITH: system_tests
70-
rvm: 2.5.7
71-
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
72-
services: docker
73-
stage: acceptance
7430
-
7531
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
7632
stage: static
7733
-
7834
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
7935
rvm: 2.5.7
8036
stage: spec
37+
-
38+
env: DEPLOY_TO_FORGE=yes
39+
stage: deploy
8140
branches:
8241
only:
8342
- main
8443
- /^v\d/
85-
- release
8644
notifications:
8745
email: false
88-
slack:
89-
secure: MrXQwGIUO7WNmLbe7iiWgURiZPUgyvDLkKe3d9S58ohE6gdN6pqlsjP8YgodK8JmIBV1zp5Wj/0cXUmY3xvCtnDmII0DCEk2Y1Cs/W1drKZtS/0BsUpJkj0rDP2fSlKsY5ifESdEta/y8+NkjRnqadbl7SQPYeek4IjAfxjjuig=

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@
8282
"description": "Module for Apache configuration",
8383
"pdk-version": "1.18.1",
8484
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
85-
"template-ref": "heads/main-0-g44cc7ed"
85+
"template-ref": "heads/main-0-g7be43a3"
8686
}

0 commit comments

Comments
 (0)