Skip to content

Run acceptance tests on macOS in GitHub CI. #163

Run acceptance tests on macOS in GitHub CI.

Run acceptance tests on macOS in GitHub CI. #163

Workflow file for this run

name: PR checks
on:
workflow_dispatch:
push:
branches:
- $default-branch
pull_request:
env:
# Enable rspec color output
SPEC_OPTS: --force-color
jobs:
test-acceptance:
name: Acceptance tests
strategy:
matrix:
include:
- os: macos-11
puppet: 8
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Puppet
run: |
set -ex
case ${{ matrix.os }} in
macos*)
brew install --cask puppetlabs/puppet/puppet-agent-${{ matrix.puppet }}
brew install --cask puppetlabs/puppet/pdk
;;
ubuntu*)
distro=$(lsb_release -cs)
deb_name="puppet${{ matrix.puppet }}-release-${distro}.deb"
curl -sSO "https://apt.puppet.com/${deb_name}"
sudo dpkg -i "$deb_name"
rm "$deb_name"
sudo apt-get update -qq
sudo apt-get install -qy puppet-agent pdk
;;
*)
echo ::error::Unsupported platform
exit 1
;;
esac
- name: Build module
run: /opt/puppetlabs/pdk/bin/pdk build
- name: Install module
run: sudo -E /opt/puppetlabs/bin/puppet module install pkg/*.tar.gz
- name: Install PDK dependencies
run: sudo -E /opt/puppetlabs/pdk/bin/pdk bundle install
- name: Run acceptance tests
run: sudo -E /opt/puppetlabs/pdk/bin/pdk bundle exec rake litmus:acceptance:localhost