-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (85 loc) · 2.43 KB
/
pr-checks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: PR checks
on:
pull_request:
workflow_dispatch:
env:
# Enable rspec color output
SPEC_OPTS: --force-color
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install PDK
run: |
set -ex
distro=$(lsb_release -cs)
curl -sSO "https://apt.puppet.com/puppet-tools-release-${distro}.deb"
sudo dpkg -i "puppet-tools-release-${distro}.deb"
rm "puppet-tools-release-${distro}.deb"
sudo apt-get update -qq
sudo apt-get install -qy pdk
- run: pdk validate
- name: Confirm REFERENCE.md is up-to-date
run: |
pdk bundle exec puppet strings generate --format markdown
git add .
git diff --staged --color --exit-code
- name: Confirm PDK update does nothing
run: |
pdk update --force
git add .
git diff --staged --color --exit-code
test-unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true
- run: bundle exec rake spec
test-acceptance:
name: Acceptance tests
strategy:
matrix:
include:
- os: ubuntu-latest
puppet: 6
- os: ubuntu-latest
puppet: 7
- os: ubuntu-latest
puppet: 8
- os: macos-13
puppet: 8
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- 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: 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