Skip to content

Commit 10a3b3c

Browse files
committed
(ci) Use shared_actions/.github/workflows/beaker_acceptance.yml
Replaces the acceptance.yaml's jobs with a call to the reusable beaker_acceptance.yml workflow from the openvoxproject/shared_actions repository. This version also takes a ref input and should be able to test 7.x suite/packages as well without switching to the 7.x branch.
1 parent bcc7874 commit 10a3b3c

File tree

1 file changed

+58
-143
lines changed

1 file changed

+58
-143
lines changed

.github/workflows/acceptance.yaml

Lines changed: 58 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
name: Beaker Acceptance Tests
33
run-name: |-
4-
Beaker acceptance tests for ${{ inputs.pre-release-build && 'pre-release' || 'release' }} packages of
5-
openvox-agent
4+
Beaker acceptance tests of openvox for
5+
${{ inputs.pre-release-build && 'pre-release' || 'release' }}
6+
packages of openvox-agent
67
${{ (inputs.pre-release-build && inputs.openvox-agent-version) ||
78
format(' collection: "{0}", version: "{1}" ',
89
inputs.collection,
@@ -18,16 +19,29 @@ run-name: |-
1819
on:
1920
workflow_dispatch:
2021
inputs:
22+
ref:
23+
description: |-
24+
(Ref) The git ref of openvox to run the Beaker test suite
25+
from.
26+
27+
If testing something from openvox8, this should be a ref off
28+
of main.
29+
30+
If testing something from openvox7, this should be a ref off
31+
of the 7.x branch.
32+
required: true
33+
type: string
34+
default: main
2135
pre-release-build:
2236
description: |-
2337
(Pre-release Build) Whether to test unreleased version
2438
packages from the artifacts server, or released packages
2539
from the given collection.
2640
27-
If this is true, versions must be valid version, not
28-
latest, and collection is ignored. The workflow will
29-
download and install the matching openvox package files
30-
from the artifacts-url server.
41+
If this is true, versions must be valid version numbers,
42+
not latest, and collection is ignored. The workflow will
43+
download and install the matching openvox package files from
44+
the artifacts-url server.
3145
3246
If this is false, version and collection must match, and the
3347
workflow will install the given openvox collection package
@@ -50,9 +64,8 @@ on:
5064
(Collection) OpenVox collection to use. (ignored if
5165
Pre-release Build is true)
5266
53-
NOTE: This should really only be set to openvox8 when
54-
testing the main branch. If you need to test openvox7, you
55-
should run the pipeline from the 7.x branch instead.
67+
If testing something from main, this should be openvox8.
68+
If testing something from 7.x, this should be openvox7.
5669
default: 'openvox8'
5770
type: string
5871
artifacts-url:
@@ -65,141 +78,43 @@ on:
6578
permissions:
6679
contents: read
6780

68-
env:
69-
RUBY_VERSION: '3.3'
70-
# Suppress warnings about Bolt gem versus package use.
71-
BOLT_GEM: true
72-
7381
jobs:
7482
acceptance:
75-
name: Acceptance Tests
76-
runs-on: ubuntu-24.04
77-
strategy:
78-
fail-fast: false
79-
matrix:
80-
os:
81-
- [almalinux, '8']
82-
- [almalinux, '9']
83-
- [debian, '11']
84-
- [debian, '12']
85-
# No builds of openvox-server in artifacts.voxpupuli.org yet
86-
# - [debian, '13', 'amd64', 'daily-latest']
87-
- [rocky, '8']
88-
- [rocky, '9']
89-
- [ubuntu, '18.04']
90-
- [ubuntu, '20.04']
91-
- [ubuntu, '22.04']
92-
- [ubuntu, '24.04']
93-
steps:
94-
- uses: actions/checkout@v4
95-
- id: vm-cluster
96-
uses: jpartlow/nested_vms@v1
97-
with:
98-
os: ${{ matrix.os[0] }}
99-
os-version: ${{ matrix.os[1] }}
100-
os-arch: ${{ matrix.os[2] || 'x86_64' }}
101-
image_version: ${{ matrix.os[3] }}
102-
host-root-access: true
103-
ruby-version: ${{ env.RUBY_VERSION }}
104-
install-openvox: false
105-
# Note: the cpu_mode is set to host-model for the sake of
106-
# el-9 which expects at least x86_64-2 arch. This depends on
107-
# the runner's architecture being sufficient, and there is
108-
# probably a better way to get this set on the libvirt
109-
# domain instead.
110-
vms: |-
111-
[
112-
{
113-
"role": "primary",
114-
"count": 1,
115-
"cpus": 4,
116-
"mem_mb": 8192,
117-
"cpu_mode": "host-model"
118-
}
119-
]
120-
- name: Write Install OpenVox Params
121-
working-directory: kvm_automation_tooling
122-
env:
123-
OPENVOX_ARTIFACTS_URL: |-
124-
${{ github.event.inputs.artifacts-url }}
125-
OPENVOX_RELEASED: |-
126-
${{ github.event.inputs.pre-release-build == 'false' }}
127-
OPENVOX_AGENT_VERSION: |-
128-
${{ ((github.event.inputs.openvox-agent-version == '') && 'latest') ||
129-
github.event.inputs.openvox-agent-version }}
130-
OPENVOX_SERVER_VERSION: |-
131-
${{ ((github.event.inputs.openvox-server-version == '') && 'latest') ||
132-
github.event.inputs.openvox-server-version }}
133-
OPENVOX_COLLECTION: ${{ github.event.inputs.collection }}
134-
# Generated by the nested_vms action.
135-
# This allows using just the Bolt inventory group names for
136-
# the target params below.
137-
INVENTORY: terraform/instances/inventory.test.yaml
138-
run: |-
139-
cat > install_openvox_params.json <<EOF
83+
uses: 'OpenVoxProject/shared-actions/.github/workflows/beaker_acceptance.yml@main'
84+
with:
85+
ref: ${{ inputs.ref }}
86+
project-name: openvox
87+
install-openvox: true
88+
openvox-collection: ${{ inputs.collection }}
89+
openvox-agent-version: ${{ inputs.openvox-agent-version }}
90+
openvox-agent-pre-release-build: ${{ inputs.pre-release-build }}
91+
install-openvox-server: true
92+
openvox-server-version: ${{ inputs.openvox-server-version }}
93+
openvox-server-pre-release-build: ${{ inputs.pre-release-build }}
94+
install-openvoxdb: false
95+
install-openvoxdb-termini: false
96+
artifacts-url: ${{ inputs.artifacts-url }}
97+
acceptance-working-dir: 'acceptance'
98+
acceptance-pre-suite: |-
99+
[
100+
"pre-suite"
101+
]
102+
acceptance-tests: |-
103+
[
104+
"tests"
105+
]
106+
beaker-options: |-
107+
{
108+
"helper": "lib/helper.rb",
109+
"options_file": "config/aio/options.rb"
110+
}
111+
vms: |-
112+
[
140113
{
141-
"openvox_agent_targets": "all",
142-
"openvox_server_targets": "primary",
143-
"openvox_agent_params": {
144-
"openvox_collection": "${OPENVOX_COLLECTION}",
145-
"openvox_version": "${OPENVOX_AGENT_VERSION}",
146-
"openvox_released": ${OPENVOX_RELEASED},
147-
"openvox_artifacts_url": "${OPENVOX_ARTIFACTS_URL}"
148-
},
149-
"openvox_server_params": {
150-
"openvox_collection": "${OPENVOX_COLLECTION}",
151-
"openvox_version": "${OPENVOX_SERVER_VERSION}",
152-
"openvox_released": ${OPENVOX_RELEASED},
153-
"openvox_artifacts_url": "${OPENVOX_ARTIFACTS_URL}"
154-
},
155-
"install_defaults": {
156-
"openvox_version": "latest",
157-
"openvox_collection": "${OPENVOX_COLLECTION}",
158-
"openvox_released": true
159-
}
114+
"role": "primary",
115+
"count": 1,
116+
"cpus": 4,
117+
"mem_mb": 8192,
118+
"cpu_mode": "host-model"
160119
}
161-
EOF
162-
cat install_openvox_params.json
163-
- name: Install OpenVox Components
164-
working-directory: kvm_automation_tooling
165-
env:
166-
# Generated by the nested_vms action.
167-
INVENTORY: terraform/instances/inventory.test.yaml
168-
run: |-
169-
bundle exec bolt plan run \
170-
kvm_automation_tooling::install_openvox \
171-
--inventory "${INVENTORY}" \
172-
--params @install_openvox_params.json
173-
- name: Construct hosts.yaml
174-
working-directory: kvm_automation_tooling
175-
env:
176-
HOSTS_YAML: ${{ github.workspace }}/acceptance/hosts.yaml
177-
# Generated by the nested_vms action.
178-
INVENTORY: terraform/instances/inventory.test.yaml
179-
run: |-
180-
bundle exec bolt plan run \
181-
kvm_automation_tooling::dev::generate_beaker_hosts_file \
182-
--inventory "${INVENTORY}" \
183-
hosts_yaml="${HOSTS_YAML}"
184-
cat "${HOSTS_YAML}"
185-
- name: Install Ruby and Run Bundler for Acceptance Tests
186-
uses: ruby/setup-ruby@v1
187-
with:
188-
ruby-version: ${{ env.RUBY_VERSION }}
189-
working-directory: acceptance
190-
bundler-cache: true
191-
- name: Run Beaker
192-
working-directory: acceptance
193-
env:
194-
# Generated by the nested_vms action.
195-
SSH_KEY: ~/.ssh/ssh-id-test
196-
run: |-
197-
bundle exec beaker init --hosts hosts.yaml \
198-
--preserve-hosts always --keyfile "${SSH_KEY}" \
199-
--pre-suite pre-suite \
200-
--tests tests
201-
# The provision step is still needed here, see notes in the
202-
# kvm_automation_tooling/templates/beaker-hosts.yaml.epp
203-
# template...
204-
bundle exec beaker provision
205-
bundle exec beaker exec
120+
]

0 commit comments

Comments
 (0)