-
Notifications
You must be signed in to change notification settings - Fork 11
116 lines (92 loc) · 3.53 KB
/
Copy pathintegration.yml
File metadata and controls
116 lines (92 loc) · 3.53 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
name: Integration test (foremanctl)
on:
workflow_dispatch:
inputs:
foremanctl_ref:
description: 'foremanctl branch or tag to test against'
required: false
default: 'master'
pull_request:
permissions:
contents: read
concurrency:
group: integration-${{ github.ref_name }}
cancel-in-progress: true
env:
IMAGE_TAG: nightly
jobs:
integration:
runs-on: ubuntu-24.04
name: foremanctl integration
steps:
- name: Checkout foreman-oci-images
uses: actions/checkout@v7
- name: Build foreman image
run: make build PROJECT=foreman FOREMAN_XY_TAG=${{ env.IMAGE_TAG }}
- name: Build foreman-proxy image
run: make build PROJECT=foreman-proxy FOREMAN_XY_TAG=${{ env.IMAGE_TAG }}
- name: Export images as tarballs
run: |
podman save -o foreman-image.tar quay.io/foreman/foreman:${{ env.IMAGE_TAG }}
podman save -o foreman-proxy-image.tar quay.io/foreman/foreman-proxy:${{ env.IMAGE_TAG }}
- name: Checkout foremanctl
uses: actions/checkout@v7
with:
repository: theforeman/foremanctl
ref: ${{ github.event.inputs.foremanctl_ref || 'master' }}
path: foremanctl
- name: Prepare images for VM transfer
run: |
mv foreman-image.tar foremanctl/
mv foreman-proxy-image.tar foremanctl/
- name: Set container_tag_stream to ${{ env.IMAGE_TAG }}
run: |
sed -i '/container_tag_stream:/ s/:.*/: "${{ env.IMAGE_TAG }}"/' foremanctl/src/vars/images.yml
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Setup libvirt for Vagrant
uses: voxpupuli/setup-vagrant@v0
- name: Install Ansible
run: pip install --upgrade ansible-core
- name: Setup environment
working-directory: foremanctl
run: ./setup-environment
- name: Start VM
working-directory: foremanctl
run: ./forge vms start --vms "quadlet"
- name: Install podman in VM
working-directory: foremanctl
run: vagrant ssh quadlet -- sudo dnf install -y podman
- name: Load images into VM
working-directory: foremanctl
run: |
vagrant ssh quadlet -- sudo podman load -i /vagrant/foreman-image.tar
vagrant ssh quadlet -- sudo podman load -i /vagrant/foreman-proxy-image.tar
- name: Free disk space
run: |
rm -f foremanctl/foreman-image.tar foremanctl/foreman-proxy-image.tar
podman system prune --all --force
- name: Configure repositories
working-directory: foremanctl
run: ./forge setup-repositories
- name: Run deployment
working-directory: foremanctl
run: |
./foremanctl deploy --initial-admin-password=changeme --tuning development --add-feature hammer --add-feature foreman-proxy --add-feature remote-execution
- name: Run tests
working-directory: foremanctl
run: |
./forge test --pytest-args="-k 'not candlepin_events' tests/foreman_target_test.py tests/foreman_test.py tests/foreman_proxy_test.py tests/redis_test.py tests/postgresql_test.py tests/httpd_test.py tests/hammer_test.py"
- name: Generate sos reports
if: ${{ always() }}
working-directory: foremanctl
run: ./forge sos
- name: Archive sos reports
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: sosreport-integration
path: foremanctl/sos/