Skip to content
---
name: Unit Tests with nightly Puppet gem
on: workflow_call
jobs:
unit_tests_with_nightly_puppet_gem:
name: Puppet${{ matrix.puppet_version }} gem on Ruby ${{ matrix.ruby }} on ${{ matrix.os_type }}
strategy:
matrix:
os: ['ubuntu-latest']
puppet_version: ['8']
include:
- puppet_version: '8'
ruby: '3.1'
- os: 'ubuntu-latest'
os_type: 'Linux'
env_set_cmd: 'export '
gem_file: 'puppet-latest.gem'
# - os: 'macos-latest'
# os_type: 'macOS'
# env_set_cmd: 'export '
# gem_file: 'puppet-latest-universal-darwin.gem'
# - os: 'windows-2022'
# os_type: 'Windows'
# env_set_cmd: '$env:'
# # setup-ruby uses ucrt for newer Rubies, but we only support mingw
# # in our Windows Puppet nightly gems. For now, we'll just install
# # the universal gem and manually install the ffi dependency.
# # Use the latest known good version of the ffi gem.
# gem_file: 'puppet-latest.gem'
# extra_steps: 'gem install ffi --version 1.16.3'
runs-on: ${{ matrix.os }}
steps:
- name: Install Twingate
uses: "puppetlabs/phoenix-gha-private/.github/workflows/twingate-setup.yaml@8c0e7e530624570aa7329e0ea0496ee1a3390780"
- name: Checkout current PR code
uses: actions/checkout@v4
- name: Install ruby version ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Circumvent multi_json 1.16.0 on ruby 2.7
if: ${{ matrix.ruby == '2.7' }}
run: gem install multi_json -v 1.15.0
- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
run: |
${{ matrix.extra_steps }}
https://artifactory.delivery.puppetlabs.net/artifactory/internal_nightly__local/downloads/gems/puppet8-nightly/puppet-latest.gem
curl https://artifactory.delivery.puppetlabs.net/artifactory/internal_nightly__local/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem --location
gem install puppet.gem -N
- name: Prepare testing environment with bundler
run: |
git config --global core.longpaths true
bundle config set system 'true'
bundle config set --local without 'release'
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
bundle update --jobs 4 --retry 3
- name: Run unit tests
run: bundle exec rake parallel_spec