Skip to content

Merge 4.9.0 into master #320

Merge 4.9.0 into master

Merge 4.9.0 into master #320

name: Test install Wazuh agent and manager - RPM
on:
pull_request:
paths:
- 'rpms/SPECS/*'
- 'rpms/generate_rpm_package.sh'
workflow_dispatch:
workflow_call:
jobs:
Wait-for-package-building:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
github_token: ${{ secrets.GITHUB_TOKEN }}
skip_after_successful_duplicate: 'false'
- name: Wait for the package to be built
uses: ArcticLampyrid/[email protected]
id: wait-for-build
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-rpm-packages.yml
sha: ${{ github.event.pull_request.head.sha || github.sha }}
wait-interval: 60
Test-install-rpm-systems:
needs: Wait-for-package-building
runs-on: ubuntu-latest
strategy:
matrix:
system:
- {NAME: 'oraclelinux:9', ARCH: "x86_64"}
- {NAME: 'almalinux:9', ARCH: "x86_64"}
- {NAME: 'rockylinux:9', ARCH: "x86_64"}
- {NAME: 'centos:7', ARCH: "x86_64"}
- {NAME: 'centos:8', ARCH: "x86_64"}
- {NAME: 'i386/centos:7', ARCH: "i386"}
- {NAME: 'redhat/ubi8:latest', ARCH: "x86_64"}
- {NAME: 'redhat/ubi9:latest', ARCH: "x86_64"}
- {NAME: 'amazonlinux:2', ARCH: "x86_64"}
- {NAME: 'fedora:34', ARCH: "x86_64"}
- {NAME: 'centos:6.9', ARCH: "x86_64", INIT: "initd"}
type: [agent, manager]
exclude:
- system: {ARCH: "i386"}
type: manager
- system: {INIT: "initd"}
type: manager
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Get changed files
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
rpm_images:
- 'rpms/CentOS/**'
- 'rpms/build.sh'
rpm_images_agent_i386:
- 'rpms/CentOS/6/i386/**'
- 'rpms/build.sh'
rpm_images_x86_64:
- 'rpms/CentOS/6/x86_64/**'
- 'rpms/CentOS/7/x86_64/**'
- 'rpms/build.sh'
rpm_packages:
- 'rpms/SPECS/**'
- 'rpms/generate_rpm_package.sh'
- name: Setup directories and variables
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
run: |
VERSION=$(cat $GITHUB_WORKSPACE/VERSION)
REVISION=$( echo ${{ github.head_ref }} | sed 's/-/./g; s/\//./g' )
echo "PACKAGE_NAME=wazuh-${{ matrix.type }}-${VERSION}-${REVISION}.${{matrix.system.ARCH}}.rpm" >> $GITHUB_ENV
- name: Download the Wazuh ${{ matrix.type }} package for ${{ matrix.system.NAME }}
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
id: download-artifact
continue-on-error: true
uses: dawidd6/action-download-artifact@v2
with:
workflow: build-rpm-packages.yml
workflow_conclusion: success
name: ${{env.PACKAGE_NAME}}
if_no_artifact_found: fail
- name: Move the Wazuh ${{ matrix.type }} package for ${{ matrix.system.NAME }} to the packages directory
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
run: |
mkdir $GITHUB_WORKSPACE/packages
mv ${{env.PACKAGE_NAME}} $GITHUB_WORKSPACE/packages
- name: Launch docker
if : steps.changes.outputs.rpm_packages == 'true' || (steps.changes.outputs.rpm_images_agent_i386 == 'true' && matrix.ARCHITECTURE == 'i386') || (steps.changes.outputs.rpm_images_x86_64 == 'true' && matrix.ARCHITECTURE == 'x86_64')
run: sudo docker run -v $GITHUB_WORKSPACE/.github/actions/test-install-components/:/tests -v $GITHUB_WORKSPACE/packages/:/packages ${{ matrix.system.NAME }} bash /tests/install_component.sh $PACKAGE_NAME ${{ matrix.type }}