Skip to content

Commit b9ebb27

Browse files
committed
syncing from "puppetlabs/support_workflows"
1 parent 7cf6b1a commit b9ebb27

File tree

1 file changed

+143
-0
lines changed

1 file changed

+143
-0
lines changed
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: "PE Nightly Acceptance Testing"
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
schedule:
7+
- cron: '25 5 * * *'
8+
9+
jobs:
10+
setup_matrix:
11+
name: "Setup Test Matrix"
12+
runs-on: ubuntu-20.04
13+
14+
steps:
15+
- name: Checkout Source
16+
uses: actions/checkout@v3
17+
if: ${{ github.repository_owner == 'puppetlabs' }}
18+
19+
- name: Activate Ruby 2.7
20+
uses: ruby/setup-ruby@v1
21+
if: ${{ github.repository_owner == 'puppetlabs' }}
22+
with:
23+
ruby-version: "2.7"
24+
bundler-cache: true
25+
26+
- name: Print bundle environment
27+
if: ${{ github.repository_owner == 'puppetlabs' }}
28+
run: |
29+
echo ::group::bundler environment
30+
bundle env
31+
echo ::endgroup::
32+
33+
Acceptance:
34+
name: "Nightly"
35+
runs-on: ubuntu-20.04
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
architecture: [standard]
40+
image: [centos-7, sles-12, sles-15, rhel-7, rhel-8]
41+
include:
42+
- image: centos-7
43+
os: el-7-x86_64
44+
- image: sles-12
45+
os: sles-12-x86_64
46+
- image: rhel-7
47+
os: el-7-x86_64
48+
- image: sles-15
49+
os: sles-15-x86_64
50+
- image: rhel-8
51+
os: el-8-x86_64
52+
53+
env:
54+
PUPPET_GEM_VERSION: '~> 7.24'
55+
56+
steps:
57+
- name: Checkout Source
58+
uses: actions/checkout@v3
59+
60+
- name: Activate Ruby 2.7
61+
uses: ruby/setup-ruby@v1
62+
with:
63+
ruby-version: "2.7"
64+
bundler-cache: true
65+
- name: Print bundle environment
66+
run: |
67+
echo ::group::bundler environment
68+
bundle env
69+
echo ::endgroup::
70+
71+
- name: 'Provision test environment'
72+
timeout-minutes: 15
73+
run: |
74+
echo ::group::prepare
75+
mkdir -p $HOME/.ssh
76+
echo 'Host *' > $HOME/.ssh/config
77+
echo ' ServerAliveInterval 150' >> $HOME/.ssh/config
78+
echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config
79+
bundle exec rake spec_prep
80+
echo ::endgroup::
81+
echo ::group::provision
82+
bundle exec bolt plan run peadm_spec::provision_test_cluster \
83+
--modulepath spec/fixtures/modules \
84+
provider=provision_service \
85+
image=${{ matrix.image }} \
86+
architecture=${{ matrix.architecture }}
87+
echo ::endgroup::
88+
echo ::group::info:request
89+
cat request.json || true; echo
90+
echo ::endgroup::
91+
echo ::group::info:inventory
92+
sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true
93+
echo ::endgroup::
94+
95+
- name: 'Activate'
96+
uses: twingate/github-action@v1
97+
with:
98+
service-key: ${{ secrets.TWINGATE_PUBLIC_REPO_KEY }}
99+
100+
- name: 'Get latest build name'
101+
id: latest
102+
run: |
103+
echo "ver=$(curl -q https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/LATEST)" >> $GITHUB_OUTPUT
104+
105+
- name: 'Install PE on test cluster'
106+
timeout-minutes: 120
107+
run: |
108+
bundle exec bolt plan run peadm_spec::install_test_cluster \
109+
--inventoryfile spec/fixtures/litmus_inventory.yaml \
110+
--modulepath spec/fixtures/modules \
111+
permit_unsafe_versions=true \
112+
code_manager_auto_configure=false \
113+
download_mode="bolthost" \
114+
--log-level debug \
115+
architecture=${{ matrix.architecture }} \
116+
pe_installer_source="https://artifactory.delivery.puppetlabs.net/artifactory/generic_enterprise__local/main/ci-ready/puppet-enterprise-${{ steps.latest.outputs.ver }}-${{ matrix.os }}.tar"
117+
- name: Install module
118+
run: |
119+
bundle exec rake 'litmus:install_module'
120+
- name: Run acceptance tests
121+
run: |
122+
bundle exec rake 'litmus:acceptance:parallel'
123+
- name: Remove test environment
124+
if: ${{ always() }}
125+
continue-on-error: true
126+
run: |
127+
if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
128+
bundle exec rake 'litmus:tear_down'
129+
echo ::group::=== REQUEST ===
130+
cat request.json || true
131+
echo
132+
echo ::endgroup::
133+
fi
134+
135+
- name: Notify slack fail
136+
if: failure()
137+
env:
138+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
139+
uses: voxmedia/github-action-slack-notify-build@v1
140+
with:
141+
channel_id: C049PL6EF9S
142+
status: FAILED
143+
color: danger

0 commit comments

Comments
 (0)