|
| 1 | +--- |
| 2 | +name: Integration test (foremanctl) |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + foremanctl_ref: |
| 8 | + description: 'foremanctl branch or tag to test against' |
| 9 | + required: false |
| 10 | + default: 'master' |
| 11 | + pull_request: |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: read |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: integration-${{ github.ref_name }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +env: |
| 21 | + IMAGE_TAG: nightly |
| 22 | + |
| 23 | +jobs: |
| 24 | + integration: |
| 25 | + runs-on: ubuntu-24.04 |
| 26 | + name: foremanctl integration |
| 27 | + steps: |
| 28 | + - name: Checkout pulpcore-oci-images |
| 29 | + uses: actions/checkout@v6 |
| 30 | + |
| 31 | + - name: Build pulp image |
| 32 | + run: make build PROJECT_XY_TAG=${{ env.IMAGE_TAG }} |
| 33 | + |
| 34 | + - name: Export images as tarballs |
| 35 | + run: | |
| 36 | + podman save -o pulp-image.tar quay.io/foreman/pulp:${{ env.IMAGE_TAG }} |
| 37 | +
|
| 38 | + - name: Checkout foremanctl |
| 39 | + uses: actions/checkout@v6 |
| 40 | + with: |
| 41 | + repository: theforeman/foremanctl |
| 42 | + ref: ${{ github.event.inputs.foremanctl_ref || 'master' }} |
| 43 | + path: foremanctl |
| 44 | + |
| 45 | + - name: Prepare images for VM transfer |
| 46 | + run: | |
| 47 | + mv pulp-image.tar foremanctl/ |
| 48 | +
|
| 49 | + - name: Set container_tag_stream to ${{ env.IMAGE_TAG }} |
| 50 | + run: | |
| 51 | + sed -i '/container_tag_stream:/ s/:.*/: "${{ env.IMAGE_TAG }}"/' foremanctl/src/vars/images.yml |
| 52 | +
|
| 53 | + - name: Set up Python |
| 54 | + uses: actions/setup-python@v6 |
| 55 | + with: |
| 56 | + python-version: '3.12' |
| 57 | + |
| 58 | + - name: Setup libvirt for Vagrant |
| 59 | + uses: voxpupuli/setup-vagrant@v0 |
| 60 | + |
| 61 | + - name: Install Ansible |
| 62 | + run: pip install --upgrade ansible-core |
| 63 | + |
| 64 | + - name: Setup environment |
| 65 | + working-directory: foremanctl |
| 66 | + run: ./setup-environment |
| 67 | + |
| 68 | + - name: Start VM |
| 69 | + working-directory: foremanctl |
| 70 | + run: ./forge vms start --vms "quadlet" |
| 71 | + |
| 72 | + - name: Install podman in VM |
| 73 | + working-directory: foremanctl |
| 74 | + run: vagrant ssh quadlet -- sudo dnf install -y podman |
| 75 | + |
| 76 | + - name: Load images into VM |
| 77 | + working-directory: foremanctl |
| 78 | + run: | |
| 79 | + vagrant ssh quadlet -- sudo podman load -i /vagrant/pulp-image.tar |
| 80 | +
|
| 81 | + - name: Free disk space |
| 82 | + run: | |
| 83 | + rm -f foremanctl/pulp-image.tar |
| 84 | + podman system prune --all --force |
| 85 | +
|
| 86 | + - name: Configure repositories |
| 87 | + working-directory: foremanctl |
| 88 | + run: ./forge setup-repositories |
| 89 | + |
| 90 | + - name: Run deployment |
| 91 | + working-directory: foremanctl |
| 92 | + run: | |
| 93 | + ./foremanctl deploy --foreman-initial-admin-password=changeme --tuning development --add-feature hammer --add-feature foreman-proxy --add-feature remote-execution |
| 94 | +
|
| 95 | + - name: Run tests |
| 96 | + working-directory: foremanctl |
| 97 | + run: | |
| 98 | + ./forge test --pytest-args="tests/pulp_test.py tests/foreman_api_test.py tests/httpd_test.py tests/foreman_test.py tests/postgresql_test.py tests/redis_test.py" |
| 99 | +
|
| 100 | + - name: Generate sos reports |
| 101 | + if: ${{ always() }} |
| 102 | + working-directory: foremanctl |
| 103 | + run: ./forge sos |
| 104 | + |
| 105 | + - name: Archive sos reports |
| 106 | + if: ${{ always() }} |
| 107 | + uses: actions/upload-artifact@v7 |
| 108 | + with: |
| 109 | + name: sosreport-integration |
| 110 | + path: foremanctl/sos/ |
0 commit comments