Skip to content

Commit af04a4c

Browse files
committed
(gha) Test install_build_artifacts task in gha
* adds a workflow to test the new install_build_artifacts task * extracts common elements to .github/actions
1 parent 27c55f1 commit af04a4c

File tree

4 files changed

+144
-37
lines changed

4 files changed

+144
-37
lines changed

.github/actions/bolt/action.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Install and Prepare Bolt
3+
description: "Helps with installing Bolt from the Puppet repository on Ubuntu distributions."
4+
5+
inputs:
6+
os-codename:
7+
description: The Ubuntu codename of the OS to install Bolt on.
8+
required: true
9+
type: string
10+
11+
run:
12+
using: "composite"
13+
steps:
14+
- name: Install Bolt
15+
shell: bash
16+
env:
17+
OS_CODENAME: ${{ inputs.os-codename }}
18+
run: |-
19+
wget https://apt.puppet.com/puppet-tools-release-${OS_CODENAME}.deb
20+
sudo dpkg -i puppet-tools-release-${OS_CODENAME}.deb
21+
sudo apt update
22+
sudo apt install -y puppet-bolt
23+
- name: Install module dependencies
24+
shell: bash
25+
run: bolt module install
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Prepare Container for Task
3+
description: "Checkouts module dependencies and ensures a wget is installed so that we can run the task scripts manually."
4+
5+
inputs:
6+
image:
7+
description: The name of the image the container is using.
8+
required: true
9+
type: string
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
repository: puppetlabs/puppetlabs-facts
17+
path: facts
18+
- name: debugging
19+
shell: bash
20+
env:
21+
IMAGE: ${{ inputs.image }}
22+
run: |
23+
pwd
24+
echo "Running on ${IMAGE}"
25+
ls -l
26+
echo "${GITHUB_WORKSPACE}"
27+
ls -l "${GITHUB_WORKSPACE}/.."
28+
- name: Ensure wget is installed (apt)
29+
if: startsWith(inputs.image, 'debian')
30+
shell: bash
31+
run: |
32+
if ! command -v wget &> /dev/null; then
33+
apt update
34+
apt install -y wget
35+
fi
36+
- name: Ensure wget is installed (dnf)
37+
if: startsWith(inputs.image, 'rocky')
38+
shell: bash
39+
run: |
40+
if ! command -v wget &> /dev/null; then
41+
dnf install -y wget
42+
fi
43+
- name: Ensure wget is installed (zypper)
44+
if: contains(inputs.image, 'suse')
45+
shell: bash
46+
run: |
47+
if ! command -v wget &> /dev/null; then
48+
zypper install -y wget
49+
fi

.github/workflows/pr_testing.yaml

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@ jobs:
3232
needs: shellcheck
3333
steps:
3434
- uses: actions/checkout@v4
35-
- name: Install Bolt
36-
run: |-
37-
wget https://apt.puppet.com/puppet-tools-release-${{ matrix.os-details.codename }}.deb
38-
sudo dpkg -i puppet-tools-release-${{ matrix.os-details.codename }}.deb
39-
sudo apt update
40-
sudo apt install -y puppet-bolt
41-
- name: Install module dependencies
42-
run: bolt module install
35+
- uses: ./.github/actions/bolt
36+
with:
37+
os-codename: ${{ matrix.os-details.codename }}
4338
- name: Run openvox-agent install task
4439
run: bolt task run openvox_bootstrap::install --targets localhost --run-as root
4540
- name: Verify openvox-agent is installed
@@ -55,6 +50,8 @@ jobs:
5550
- debian:10
5651
- debian:11
5752
- debian:12
53+
- fedora:42
54+
- ubuntu:24.04
5855
# Need to pull in the repo GPG keys for sles
5956
# - registry.suse.com/suse/sle15:15.6
6057
needs: shellcheck
@@ -64,36 +61,9 @@ jobs:
6461
- uses: actions/checkout@v4
6562
with:
6663
path: openvox_bootstrap
67-
- uses: actions/checkout@v4
64+
- uses: ./openvox_bootstrap/.github/actions/container_task_prep
6865
with:
69-
repository: puppetlabs/puppetlabs-facts
70-
path: facts
71-
- name: debugging
72-
run: |
73-
pwd
74-
echo "Running on ${{ matrix.image }}"
75-
ls -l
76-
echo "${GITHUB_WORKSPACE}"
77-
ls -l "${GITHUB_WORKSPACE}/.."
78-
- name: Ensure wget is installed (apt)
79-
if: startsWith(matrix.image, 'debian')
80-
run: |
81-
if ! command -v wget &> /dev/null; then
82-
apt update
83-
apt install -y wget
84-
fi
85-
- name: Ensure wget is installed (dnf)
86-
if: startsWith(matrix.image, 'rocky')
87-
run: |
88-
if ! command -v wget &> /dev/null; then
89-
dnf install -y wget
90-
fi
91-
- name: Ensure wget is installed (zypper)
92-
if: contains(matrix.image, 'suse')
93-
run: |
94-
if ! command -v wget &> /dev/null; then
95-
zypper install -y wget
96-
fi
66+
image: ${{ matrix.image }}
9767
- name: Run openvox-agent install task manually
9868
env:
9969
PT__installdir: ${{ github.workspace }}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
name: 'PR Tests of the install_build_artifact task'
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
test-install-build-artifact-task-on-ubuntu:
14+
strategy:
15+
matrix:
16+
os-details:
17+
- os: ubuntu-22.04
18+
codename: jammy
19+
# - os: ubuntu-24.04
20+
# codename: noble
21+
# Perforce hasn't yet released bolt on 24.04.
22+
runs-on: ${{ matrix.os-details.os }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: ./.github/actions/bolt
26+
with:
27+
os-codename: ${{ matrix.os-details.codename }}
28+
- name: Run openvox-agent install task
29+
run: bolt task run openvox_bootstrap::install_build_artifacts version=8.15.0 --targets localhost --run-as root
30+
- name: Verify openvox-agent is installed
31+
run: |-
32+
[[ "$(/opt/puppetlabs/bin/puppet --version)" = "8.15.0" ]]
33+
34+
test-install-build-artifact-task-on-other-os-via-containers:
35+
strategy:
36+
matrix:
37+
image:
38+
- rockylinux:8
39+
- rockylinux:9
40+
- debian:10
41+
- debian:11
42+
- debian:12
43+
- fedora:42
44+
- ubuntu:24.04
45+
# Need to pull in the repo GPG keys for sles
46+
# - registry.suse.com/suse/sle15:15.6
47+
runs-on: ubuntu-latest
48+
container: ${{ matrix.image }}
49+
steps:
50+
- uses: actions/checkout@v4
51+
with:
52+
path: openvox_bootstrap
53+
- uses: ./openvox_bootstrap/.github/actions/container_task_prep
54+
with:
55+
image: ${{ matrix.image }}
56+
- name: Run openvox-agent install task manually
57+
env:
58+
PT__installdir: ${{ github.workspace }}
59+
PT_version: "8.15.0"
60+
run: ./openvox_bootstrap/tasks/install_build_artifact_linux.sh
61+
- name: Verify openvox-agent is installed
62+
run: |-
63+
[[ "$(/opt/puppetlabs/bin/puppet --version)" = "8.15.0" ]]

0 commit comments

Comments
 (0)