Skip to content

Commit 469e2bd

Browse files
committed
(maint) add postgresql module to ci
1 parent b193ad1 commit 469e2bd

18 files changed

+942
-177
lines changed

.devcontainer/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM puppet/pdk:latest
2+
3+
# [Optional] Uncomment this section to install additional packages.
4+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5+
# && apt-get -y install --no-install-recommends <your-package-list-here>
6+

.devcontainer/devcontainer.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
3+
{
4+
"name": "Puppet Development Kit (Community)",
5+
"dockerFile": "Dockerfile",
6+
7+
// Set *default* container specific settings.json values on container create.
8+
"settings": {
9+
"terminal.integrated.shell.linux": "/bin/bash"
10+
},
11+
12+
// Add the IDs of extensions you want installed when the container is created.
13+
"extensions": [
14+
"puppet.puppet-vscode",
15+
"rebornix.Ruby"
16+
]
17+
18+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
19+
// "forwardPorts": [],
20+
21+
// Use 'postCreateCommand' to run commands after the container is created.
22+
// "postCreateCommand": "pdk --version",
23+
}

.github/workflows/nightly.yml

+217
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
name: "nightly"
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
env:
8+
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
9+
HONEYCOMB_DATASET: litmus tests
10+
11+
jobs:
12+
setup_matrix:
13+
name: "Setup Test Matrix"
14+
runs-on: ubuntu-20.04
15+
outputs:
16+
matrix: ${{ steps.get-matrix.outputs.matrix }}
17+
18+
steps:
19+
- name: "Honeycomb: Start recording"
20+
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # [email protected]
21+
with:
22+
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
23+
dataset: ${{ env.HONEYCOMB_DATASET }}
24+
job-status: ${{ job.status }}
25+
26+
- name: "Honeycomb: Start first step"
27+
run: |
28+
echo STEP_ID=0 >> $GITHUB_ENV
29+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
30+
31+
- name: Checkout Source
32+
uses: actions/checkout@v2
33+
if: ${{ github.repository_owner == 'puppetlabs' }}
34+
35+
- name: Activate Ruby 2.7
36+
uses: actions/setup-ruby@v1
37+
if: ${{ github.repository_owner == 'puppetlabs' }}
38+
with:
39+
ruby-version: "2.7"
40+
41+
- name: Cache gems
42+
uses: actions/cache@v2
43+
if: ${{ github.repository_owner == 'puppetlabs' }}
44+
with:
45+
path: vendor/gems
46+
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
47+
restore-keys: |
48+
${{ runner.os }}-${{ github.event_name }}-
49+
${{ runner.os }}-
50+
51+
- name: Install gems
52+
if: ${{ github.repository_owner == 'puppetlabs' }}
53+
run: |
54+
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
55+
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
56+
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
57+
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
58+
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
59+
60+
- name: Setup Acceptance Test Matrix
61+
id: get-matrix
62+
if: ${{ github.repository_owner == 'puppetlabs' }}
63+
run: |
64+
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
65+
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata
66+
else
67+
echo "::set-output name=matrix::{}"
68+
fi
69+
70+
- name: "Honeycomb: Record setup time"
71+
if: ${{ always() }}
72+
run: |
73+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
74+
75+
Acceptance:
76+
needs:
77+
- setup_matrix
78+
79+
runs-on: ubuntu-20.04
80+
strategy:
81+
fail-fast: false
82+
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
83+
84+
env:
85+
BUILDEVENT_FILE: '../buildevents.txt'
86+
87+
steps:
88+
- run: |
89+
echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE
90+
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
91+
92+
- name: "Honeycomb: Start recording"
93+
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # [email protected]
94+
with:
95+
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
96+
dataset: ${{ env.HONEYCOMB_DATASET }}
97+
job-status: ${{ job.status }}
98+
matrix-key: ${{ matrix.platform }}-${{ matrix.collection }}
99+
100+
- name: "Honeycomb: start first step"
101+
run: |
102+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
103+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
104+
105+
- name: Checkout Source
106+
uses: actions/checkout@v2
107+
108+
- name: Activate Ruby 2.7
109+
uses: actions/setup-ruby@v1
110+
with:
111+
ruby-version: "2.7"
112+
113+
- name: Cache gems
114+
uses: actions/cache@v2
115+
with:
116+
path: vendor/gems
117+
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
118+
restore-keys: |
119+
${{ runner.os }}-${{ github.event_name }}-
120+
${{ runner.os }}-
121+
122+
- name: "Honeycomb: Record cache setup time"
123+
if: ${{ always() }}
124+
run: |
125+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval'
126+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
127+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
128+
129+
- name: Bundler Setup
130+
run: |
131+
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
132+
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
133+
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
134+
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
135+
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
136+
echo ::group::bundler environment
137+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
138+
echo ::endgroup::
139+
140+
- name: "Honeycomb: Record Bundler Setup time"
141+
if: ${{ always() }}
142+
run: |
143+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
144+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
145+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
146+
147+
- name: Provision test environment
148+
run: |
149+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]'
150+
echo ::group::=== REQUEST ===
151+
cat request.json || true
152+
echo
153+
echo ::endgroup::
154+
echo ::group::=== INVENTORY ===
155+
sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
156+
echo ::endgroup::
157+
158+
- name: Install agent
159+
run: |
160+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
161+
162+
- name: Install module
163+
run: |
164+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
165+
166+
- name: "Honeycomb: Record deployment times"
167+
if: ${{ always() }}
168+
run: |
169+
echo ::group::honeycomb step
170+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
171+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
172+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
173+
echo ::endgroup::
174+
175+
- name: Run acceptance tests
176+
run: |
177+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
178+
179+
- name: "Honeycomb: Record acceptance testing times"
180+
if: ${{ always() }}
181+
run: |
182+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
183+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
184+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
185+
186+
- name: Remove test environment
187+
if: ${{ always() }}
188+
run: |
189+
if [ -f inventory.yaml ]; then
190+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
191+
echo ::group::=== REQUEST ===
192+
cat request.json || true
193+
echo
194+
echo ::endgroup::
195+
fi
196+
197+
- name: "Honeycomb: Record removal times"
198+
if: ${{ always() }}
199+
run: |
200+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
201+
202+
slack-workflow-status:
203+
if: always()
204+
name: Post Workflow Status To Slack
205+
needs:
206+
- Acceptance
207+
runs-on: ubuntu-20.04
208+
steps:
209+
- name: Slack Workflow Notification
210+
uses: Gamesight/slack-workflow-status@88ee95b73b4669825883ddf22747966204663e58 # pin@master
211+
with:
212+
# Required Input
213+
repo_token: ${{ secrets.GITHUB_TOKEN }}
214+
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }}
215+
# Optional Input
216+
channel: '#team-ia-bots'
217+
name: 'GABot'

0 commit comments

Comments
 (0)