Skip to content

pdksync - Update gha templates #1229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 22 additions & 45 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,33 @@ jobs:

- name: "Honeycomb: Start first step"
run: |
echo STEP_ID=0 >> $GITHUB_ENV
echo STEP_ID=setup-environment >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Checkout Source
uses: actions/checkout@v2
if: ${{ github.repository_owner == 'puppetlabs' }}

- name: Activate Ruby 2.7
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
ruby-version: "2.7"
bundler-cache: true

- name: Cache gems
uses: actions/cache@v2
- name: Print bundle environment
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
path: vendor/gems
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-${{ github.event_name }}-
${{ runner.os }}-
run: |
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
echo ::endgroup::

- name: Install gems
- name: "Honeycomb: Record Setup Environment time"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Setup Acceptance Test Matrix
id: get-matrix
Expand All @@ -67,7 +63,7 @@ jobs:
echo "::set-output name=matrix::{}"
fi

- name: "Honeycomb: Record setup time"
- name: "Honeycomb: Record Setup Test Matrix time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
Expand Down Expand Up @@ -106,42 +102,22 @@ jobs:
uses: actions/checkout@v2

- name: Activate Ruby 2.7
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true

- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/gems
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-${{ github.event_name }}-
${{ runner.os }}-

- name: "Honeycomb: Record cache setup time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Bundler Setup
- name: Print bundle environment
run: |
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
echo ::endgroup::

- name: "Honeycomb: Record Bundler Setup time"
- name: "Honeycomb: Record Setup Environment time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Provision test environment
Expand All @@ -168,7 +144,7 @@ jobs:
run: |
echo ::group::honeycomb step
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
echo ::endgroup::

Expand All @@ -180,11 +156,12 @@ jobs:
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Remove test environment
if: ${{ always() }}
continue-on-error: true
run: |
if [ -f inventory.yaml ]; then
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
Expand Down
67 changes: 22 additions & 45 deletions .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,33 @@ jobs:

- name: "Honeycomb: Start first step"
run: |
echo STEP_ID=0 >> $GITHUB_ENV
echo STEP_ID=setup-environment >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Checkout Source
uses: actions/checkout@v2
if: ${{ github.repository_owner == 'puppetlabs' }}

- name: Activate Ruby 2.7
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
ruby-version: "2.7"
bundler-cache: true

- name: Cache gems
uses: actions/cache@v2
- name: Print bundle environment
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
path: vendor/gems
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-${{ github.event_name }}-
${{ runner.os }}-
run: |
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
echo ::endgroup::

- name: Install gems
- name: "Honeycomb: Record Setup Environment time"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Setup Acceptance Test Matrix
id: get-matrix
Expand All @@ -64,7 +60,7 @@ jobs:
echo "::set-output name=matrix::{}"
fi

- name: "Honeycomb: Record setup time"
- name: "Honeycomb: Record Setup Test Matrix time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
Expand Down Expand Up @@ -104,42 +100,22 @@ jobs:
uses: actions/checkout@v2

- name: Activate Ruby 2.7
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true

- name: Cache gems
uses: actions/cache@v2
with:
path: vendor/gems
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-${{ github.event_name }}-
${{ runner.os }}-

- name: "Honeycomb: Record cache setup time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Bundler Setup
- name: Print bundle environment
run: |
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
echo ::endgroup::

- name: "Honeycomb: Record Bundler Setup time"
- name: "Honeycomb: Record Setup Environment time"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Provision test environment
Expand All @@ -166,7 +142,7 @@ jobs:
run: |
echo ::group::honeycomb step
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
echo ::endgroup::

Expand All @@ -178,11 +154,12 @@ jobs:
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV

- name: Remove test environment
if: ${{ always() }}
continue-on-error: true
run: |
if [ -f inventory.yaml ]; then
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ end
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']

group :development do
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
Expand All @@ -35,6 +31,10 @@ group :system_tests do
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
hiera_version = ENV['HIERA_GEM_VERSION']

gems = {}

gems['puppet'] = location_for(puppet_version)
Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'bundler'
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"version_requirement": ">= 5.5.10 < 8.0.0"
}
],
"pdk-version": "1.18.1",
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
"template-ref": "heads/main-0-gdace7b2"
"pdk-version": "1.19.0.pre (47)",
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
"template-ref": "heads/main-0-g1862b96"
}