13 changes: 12 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
fixtures:
forge_modules:
# stdlib: "puppetlabs/stdlib"
fixtures:
service: "puppetlabs/service"
package: "puppetlabs/package"
reboot: "puppetlabs/reboot"
repositories:
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
apt: 'https://github.com/puppetlabs/puppetlabs-apt'
Expand All @@ -25,3 +27,12 @@ fixtures:
ruby_task_helper: 'https://git@github.com/puppetlabs/puppetlabs-ruby_task_helper'
cron_core: 'https://github.com/puppetlabs/puppetlabs-cron_core'
bootstrap: 'https://github.com/puppetlabs/puppetlabs-bootstrap'
node_manager: 'https://github.com/WhatsARanjit/puppet-node_manager'
apply_helpers: 'https://github.com/puppetlabs/puppetlabs-apply_helpers'
bolt_shim: 'https://github.com/puppetlabs/puppetlabs-bolt_shim'
debug: 'https://github.com/nwops/puppet-debug'
format: 'https://github.com/voxpupuli/puppet-format'
container_inventory: 'https://gitlab.com/nwops/bolt-container_inventory'
peadm: 'https://github.com/puppetlabs/puppetlabs-peadm.git'
symlinks:
peadm_spec: "#{source_dir}/spec/fixtures/modules/peadm/spec/acceptance/peadm_spec/"
6 changes: 3 additions & 3 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: "Checkout Source"
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
Expand All @@ -44,13 +44,13 @@ jobs:
if: ${{ github.repository_owner == 'puppetlabs' }}
id: gv
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
echo "ver=$(jq --raw-output .version metadata.json)" >> $GITHUB_OUTPUT
- name: "Check if a release is necessary"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: check
run: |
git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
git diff --quiet CHANGELOG.md && echo "release=false" >> $GITHUB_OUTPUT || echo "release=true" >> $GITHUB_OUTPUT
- name: "Commit changes"
if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/pe_latest_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

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

- name: Activate Ruby 2.7
Expand All @@ -34,22 +34,22 @@ jobs:
- name: Curl Forge for PE versions
id: curl_forge
run: |
echo "::set-output name=forge_response::$(curl https://forge.puppet.com/private/versions/pe)"
echo "forge_response=$(curl https://forge.puppet.com/private/versions/pe)" >> $GITHUB_OUTPUT
- name: Set latest release
id: latest_release
run: |
out=$(jq -c '[.[] | select(.lts == false)][0].latest | {"collection": [.]}' <<<'${{ steps.curl_forge.outputs.forge_response }}')
echo "::set-output name=latest::$out"
echo "latest=$out" >> $GITHUB_OUTPUT
- name: Setup Acceptance Test Matrix
id: get-matrix
run: |
if [[ -e spec/fixtures/matrix/latest.json ]]; then
out=$(jq -c '. + ($matrix | .[])' --slurpfile matrix spec/fixtures/matrix/latest.json <<<'${{ steps.latest_release.outputs.latest }}')
echo "::set-output name=matrix::$out"
echo "matrix=$out" >> $GITHUB_OUTPUT
else
echo "::set-output name=matris::{}"
echo "matrix={}" >> $GITHUB_OUTPUT
fi
Acceptance:
Expand All @@ -62,10 +62,11 @@ jobs:
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
PUPPET_GEM_VERSION: '~> 7.24'
steps:
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Activate Ruby 2.7
uses: ruby/setup-ruby@v1
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/pe_lts_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

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

- name: Activate Ruby 2.7
Expand All @@ -34,22 +34,22 @@ jobs:
- name: Curl Forge for PE versions
id: curl_forge
run: |
echo "::set-output name=forge_response::$(curl https://forge.puppet.com/private/versions/pe)"
echo "forge_response=$(curl https://forge.puppet.com/private/versions/pe)" >> $GITHUB_OUTPUT
- name: Set latest release
id: latest_release
run: |
out=$(jq -c '[.[] | select(.lts == true)][0].latest | {"collection": [.]}' <<<'${{ steps.curl_forge.outputs.forge_response }}')
echo "::set-output name=latest::$out"
echo "latest=$out" >> $GITHUB_OUTPUT
- name: Setup Acceptance Test Matrix
id: get-matrix
run: |
if [[ -e spec/fixtures/matrix/lts.json ]]; then
out=$(jq -c '. + ($matrix | .[])' --slurpfile matrix spec/fixtures/matrix/lts.json <<<'${{ steps.latest_release.outputs.latest }}')
echo "::set-output name=matrix::$out"
echo "matrix=$out" >> $GITHUB_OUTPUT
else
echo "::set-output name=matris::{}"
echo "matrix={}" >> $GITHUB_OUTPUT
fi
Expand All @@ -63,10 +63,13 @@ jobs:
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}


env:
PUPPET_GEM_VERSION: '~> 7.24'

steps:
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Activate Ruby 2.7
uses: ruby/setup-ruby@v1
Expand Down
118 changes: 118 additions & 0 deletions .github/workflows/pe_nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: "PE Nightly Acceptance Testing"

on:
workflow_dispatch:
workflow_call:

jobs:
setup_matrix:
name: "Setup Test Matrix"
runs-on: ubuntu-20.04

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

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

- name: Print bundle environment
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::
Acceptance:
name: "Nightly"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
architecture:
- 'standard'
image:
- 'centos-7'

steps:
- name: Checkout Source
uses: actions/checkout@v2

- name: Activate Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true
- name: Print bundle environment
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::
- name: 'Provision test environment'
timeout-minutes: 15
run: |
echo ::group::prepare
mkdir -p $HOME/.ssh
echo 'Host *' > $HOME/.ssh/config
echo ' ServerAliveInterval 150' >> $HOME/.ssh/config
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
bundle exec rake spec_prep
echo ::endgroup::
echo ::group::provision
bundle exec bolt plan run peadm_spec::provision_test_cluster \
--modulepath spec/fixtures/modules \
provider=provision_service \
image=${{ matrix.image }} \
architecture=${{ matrix.architecture }}
echo ::endgroup::
echo ::group::info:request
cat request.json || true; echo
echo ::endgroup::
echo ::group::info:inventory
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
echo ::endgroup::
- name: 'Activate'
uses: twingate/github-action@v1
with:
service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }}

- name: 'Get latest build name'
id: latest
run: |
echo "::set-output name=ver::$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)"
- name: 'Install PE on test cluster'
timeout-minutes: 120
run: |
bundle exec bolt plan run peadm_spec::install_test_cluster \
--inventoryfile spec/fixtures/litmus_inventory.yaml \
--modulepath spec/fixtures/modules \
permit_unsafe_versions=true \
download_mode="bolthost" \
architecture=${{ matrix.architecture }} \
pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-el-7-x86_64.tar"
- name: Install module
run: |
bundle exec rake 'litmus:install_module'
- name: Run acceptance tests
run: |
bundle exec rake 'litmus:acceptance:parallel'
- name: Remove test environment
if: ${{ always() }}
continue-on-error: true
run: |
if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
bundle exec rake 'litmus:tear_down'
echo ::group::=== REQUEST ===
cat request.json || true
echo
echo ::endgroup::
fi
Loading