From 88589ee951267096768caf028da2b13832f71e77 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 4 Feb 2025 09:09:32 +0100 Subject: [PATCH] fix: fetch package in package testing workflow --- .github/actions/test-install-components/action.yml | 3 ++- .github/workflows/linux_package_binaries.yml | 4 ---- .github/workflows/linux_test_deb_package.yml | 8 ++++---- .github/workflows/linux_test_rpm_package.yml | 8 ++++---- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/actions/test-install-components/action.yml b/.github/actions/test-install-components/action.yml index af2ff66443..bd24672304 100644 --- a/.github/actions/test-install-components/action.yml +++ b/.github/actions/test-install-components/action.yml @@ -26,7 +26,8 @@ runs: $${{ env.PACKAGE_NAME }} agent - name: Check test result - shell: bash + shell: bash + run: | if grep -iq " installed.*wazuh-agent" /tmp/status.log ; then echo "Installation successfully." else diff --git a/.github/workflows/linux_package_binaries.yml b/.github/workflows/linux_package_binaries.yml index a674606947..8803f80508 100644 --- a/.github/workflows/linux_package_binaries.yml +++ b/.github/workflows/linux_package_binaries.yml @@ -98,8 +98,6 @@ jobs: Build-agent-linux-packages: runs-on: ${{ (inputs.architecture == 'arm64' || inputs.architecture == 'aarch64') && 'wz-linux-arm64' || 'ubuntu-latest' }} timeout-minutes: 25 - outputs: - package_name: ${{ steps.package-built.outputs.PACKAGE_NAME }} name: Package Wazuh agent binaries Linux ${{ inputs.architecture }} - ${{ inputs.system }} - agent packages ${{ inputs.is_stage && ' - is stage' || '' }}${{ inputs.checksum && ' - checksum' || '' }} - ${{ inputs.id }} steps: @@ -129,7 +127,6 @@ jobs: docker_image_tag: ${{ env.TAG }} - name: Build ${{ inputs.system }} wazuh-agent on ${{ env.ARCH }} - id: package-built run: | REVISION=${{ inputs.revision }} FLAGS="--verbose -s /tmp --dont-build-docker -j $(nproc) " @@ -139,7 +136,6 @@ jobs: echo "generate_package.sh -a ${{ env.ARCH }} --tag ${{ env.TAG }} --system ${{ inputs.system }} $FLAGS" sudo bash packages/generate_package.sh -a ${{ env.ARCH }} --tag ${{ env.TAG }} --system ${{ inputs.system }} $FLAGS echo "PACKAGE_NAME=$(find /tmp -maxdepth 1 -type f -name *agent*.${{ inputs.system }} -exec basename {} 2>/dev/null \;| grep -v -E "^(wazuh-agent-dbg|wazuh-agent-debuginfo)")" | tee -a $GITHUB_ENV - echo "PACKAGE_NAME=$(find /tmp -maxdepth 1 -type f -name *agent*.${{ inputs.system }} -exec basename {} 2>/dev/null \;| grep -v -E "^(wazuh-agent-dbg|wazuh-agent-debuginfo)")" >> $GITHUB_OUTPUT - name: Set up AWS CLI if: ${{ inputs.upload_to_s3 }} diff --git a/.github/workflows/linux_test_deb_package.yml b/.github/workflows/linux_test_deb_package.yml index b65a886fa4..0cc03a7470 100644 --- a/.github/workflows/linux_test_deb_package.yml +++ b/.github/workflows/linux_test_deb_package.yml @@ -55,12 +55,12 @@ jobs: - name: Download wazuh agent package uses: actions/download-artifact@v4 with: - name: ${{ needs.build-package-agent-linux-deb-packages.outputs.package_name }} + pattern: '*.deb' + path: '/tmp' - - name: Unzip package + - name: Get package name run: | - unzip ${{ needs.build-package-agent-linux-deb-packages.outputs.package_name }}.zip -d /tmp - echo "PACKAGE_NAME=${{ needs.build-package-agent-linux-deb-packages.outputs.package_name }}" >> $GITHUB_ENV + echo "PACKAGE_NAME=$(find /tmp -maxdepth 1 -type f -name *agent* -exec basename {} 2>/dev/null \;| grep -v -E "^(wazuh-agent-dbg|wazuh-agent-debuginfo)")" | tee -a $GITHUB_ENV - name: Test DEB package installation uses: ./.github/actions/test-install-components diff --git a/.github/workflows/linux_test_rpm_package.yml b/.github/workflows/linux_test_rpm_package.yml index 14ba043891..a88c01fff8 100644 --- a/.github/workflows/linux_test_rpm_package.yml +++ b/.github/workflows/linux_test_rpm_package.yml @@ -55,12 +55,12 @@ jobs: - name: Download wazuh agent package uses: actions/download-artifact@v4 with: - name: ${{ needs.build-package-agent-linux-rpm-packages.outputs.package_name }} + pattern: '*.rpm' + path: '/tmp' - - name: Unzip package + - name: Get package name run: | - unzip ${{ needs.build-package-agent-linux-deb-packages.outputs.package_name }}.zip -d /tmp - echo "PACKAGE_NAME=${{ needs.build-package-agent-linux-deb-packages.outputs.package_name }}" >> $GITHUB_ENV + echo "PACKAGE_NAME=$(find /tmp -maxdepth 1 -type f -name *agent* -exec basename {} 2>/dev/null \;| grep -v -E "^(wazuh-agent-dbg|wazuh-agent-debuginfo)")" | tee -a $GITHUB_ENV - name: Test RPM package installation uses: ./.github/actions/test-install-components