Skip to content

Commit b36eecf

Browse files
authored
Merge pull request #376 from puppetlabs/pdksync_pdkupdate
pdksync - PDK Update - Replace Travis and Appveyor with Github Actions
2 parents 1a4dd7f + 9367214 commit b36eecf

File tree

8 files changed

+182
-202
lines changed

8 files changed

+182
-202
lines changed

.github/workflows/auto_release.yml

Lines changed: 1 addition & 1 deletion
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:

.github/workflows/release.yml

Lines changed: 42 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,47 @@
1+
name: "Publish module"
12

2-
name: "release"
3-
4-
on:
5-
push:
6-
branches:
7-
- 'release'
8-
3+
on:
4+
workflow_dispatch:
5+
96
jobs:
10-
LitmusAcceptance2012Sql:
11-
runs-on: self-hosted
12-
strategy:
13-
matrix:
14-
ruby_version: [2.5.x]
15-
puppet_gem_version: [~> 6.0]
16-
platform: [release_checks_sql_2012]
17-
agent_family: ['puppet5', 'puppet6']
18-
7+
create-github-release:
8+
name: Deploy GitHub Release
9+
runs-on: ubuntu-20.04
1910
steps:
20-
- uses: actions/checkout@v1
21-
- name: Litmus Parallel
22-
uses: puppetlabs/action-litmus_parallel@main
23-
with:
24-
platform: ${{ matrix.platform }}
25-
agent_family: ${{ matrix.agent_family }}
26-
additional_command: ${{ matrix.additional_command }}
27-
LitmusAcceptance2014Sql:
28-
runs-on: self-hosted
29-
strategy:
30-
matrix:
31-
ruby_version: [2.5.x]
32-
puppet_gem_version: [~> 6.0]
33-
platform: [release_checks_sql_2014]
34-
agent_family: ['puppet5', 'puppet6']
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
3530

31+
deploy-forge:
32+
name: Deploy to Forge
33+
runs-on: ubuntu-20.04
3634
steps:
37-
- uses: actions/checkout@v1
38-
- name: Litmus Parallel
39-
uses: puppetlabs/action-litmus_parallel@main
40-
with:
41-
platform: ${{ matrix.platform }}
42-
agent_family: ${{ matrix.agent_family }}
43-
additional_command: ${{ matrix.additional_command }}
44-
LitmusAcceptance2016Sql:
45-
runs-on: self-hosted
46-
strategy:
47-
matrix:
48-
ruby_version: [2.5.x]
49-
puppet_gem_version: [~> 6.0]
50-
platform: [release_checks_sql_2016_parity]
51-
agent_family: ['puppet5', 'puppet6']
52-
additional_command: ['bundle exec rake litmus:add_feature[sqlversion_2016]']
53-
54-
steps:
55-
- uses: actions/checkout@v1
56-
- name: Litmus Parallel
57-
uses: puppetlabs/action-litmus_parallel@main
58-
with:
59-
platform: ${{ matrix.platform }}
60-
agent_family: ${{ matrix.agent_family }}
61-
additional_command: ${{ matrix.additional_command }}
62-
63-
Spec:
64-
runs-on: self-hosted
65-
strategy:
66-
matrix:
67-
check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop']
68-
ruby_version: [2.5.x]
69-
puppet_gem_version: [~> 5.0, ~> 6.0]
70-
exclude:
71-
- puppet_gem_version: ~> 5.0
72-
check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
73-
- ruby_version: 2.5.x
74-
puppet_gem_version: ~> 5.0
75-
steps:
76-
- uses: actions/checkout@v1
77-
- name: Spec Tests
78-
uses: puppetlabs/action-litmus_spec@main
79-
with:
80-
puppet_gem_version: ${{ matrix.puppet_gem_version }}
81-
check: ${{ matrix.check }}
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: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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 Spec 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 Static & Syntax Tests
123+
run: |
124+
buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
125+
126+
- name: Run parallel_spec tests
127+
run: |
128+
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: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +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-
simplecov: true
12-
notifications:
13-
slack:
14-
secure: >-
15-
NT68BqwAuUSDfmHKZM1Zq7hu2CsK/O2zUhQdeeMBzMWqc6stFdBs8w4zilejzbKJBGSKczV05ctg30e3BfUxGdkuB5kmUCncr5Ky/ygnTi6HnVmdb6ia2Dh41aIoE902SB4h87cOnwcaWAVUBs7lRkJt8j3fK7EZ1egwwzoVaneG/YSMCMniBqSUZFMq5JK76SNBf7VsUzdnxo+nJKJQwMeDQgejb5Fs5F4ua6uSV/keYN7fUjrTLIRA2DKc0nk9fbp8wEN1e12fD0Dziqdlj0jxgJ+8HRAALk82Xu4HivAtOXrGSiXtan2JivbvQW0vFOAd/K1W4ax6ovsZewe4bhMFqgHvdczrlrXFdbKK3cbCJln+StauiWiAVy1wnL2j08zcqxxMPG2HUOpqKjb32CNr+IQZ1GRkx+r62+y18wRb9ir8cTmQli9PcPYFYdM4/5845jaG24qXTQA7s8/f3M7rHgzbZ2ilV6FI76k2iJHX4HAioRW5sD+nIE0STJMnlaVPXmmBhkGwEgoU2Vxbxvas4nCBUikPDoRh5zmY57FaaqJpUEyUgliTWF3OOO8F3xdyv2mdsoMQWi+xBC8CPNOAsTeocYVuZzKOf76eOfwMGcpAp/D8+kAYjb9UFK9tbtil7oeU2hP8kNp+X8AQnM3fxXeGyS1IOeTYAAFfBoI=
166
appveyor.yml:
17-
environment:
18-
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
19-
HONEYCOMB_DATASET: litmus tests
20-
matrix_extras:
21-
- PUPPET_GEM_VERSION: "~> 6.0"
22-
RUBY_VERSION: 25
23-
CHECK: parallel_spec
24-
- PUPPET_GEM_VERSION: "~> 6.0"
25-
RUBY_VERSION: 25-x64
26-
CHECK: parallel_spec
27-
simplecov: true
7+
delete: true
8+
289
Gemfile:
2910
optional:
3011
":development":
@@ -43,3 +24,10 @@ spec/spec_helper.rb:
4324
unmanaged: false
4425
.github/workflows/auto_release.yml:
4526
unmanaged: false
27+
.github/workflows/spec.yml:
28+
checks: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
29+
unmanaged: false
30+
.github/workflows/release.yml:
31+
unmanaged: false
32+
.travis.yml:
33+
delete: true

.travis.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)