From ba80f535bdc78beb93f790d0e551e09783523aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 17:01:57 +0100 Subject: [PATCH] Add testing of RPM packages --- .github/workflows/build.yml | 5 ++++- .github/workflows/r_test.yml | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a6dfae4fe285..5ecabc5404f70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,6 +67,9 @@ jobs: test: needs: [version, commit_sha, assemble] + strategy: + matrix: + os: [ {suffix: "amd64", ext: "deb"}, {suffix: "x86_64", ext: "rpm"} ] uses: ./.github/workflows/r_test.yml with: - package: wazuh-indexer-${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}_amd64_${{ needs.commit_sha.outputs.commit_sha }}.deb \ No newline at end of file + package: wazuh-indexer-${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}_${{ matrix.os.suffix }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.os.ext }} \ No newline at end of file diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 648b37bf20bda..5dc38ea8972fa 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -24,12 +24,20 @@ jobs: name: ${{ inputs.package }} path: artifacts/dist - - name: Install package + - name: Install package (RPM) + if: endsWith(${{ inputs.package }}, "rpm") + run: | + sudo yum localinstall "artifacts/dist/${{ inputs.package }}" + + - name: Install package (DEB) + if: endsWith(${{ inputs.package }}, "deb") run: | sudo dpkg -i "artifacts/dist/${{ inputs.package }}" - uses: actions/checkout@v4 + if: endsWith(${{ inputs.package }}, "deb") - name: Generate and deploy certificates + if: endsWith(${{ inputs.package }}, "deb") uses: addnab/docker-run-action@v3 with: image: wazuh/wazuh-certs-generator:0.0.1 @@ -48,17 +56,21 @@ jobs: ls /certs - run: sudo systemctl daemon-reload - - run: | + if: endsWith(${{ inputs.package }}, "deb") + - if: endsWith(${{ inputs.package }}, "deb") + run: | if ! sudo systemctl enable wazuh-indexer.service; then sudo journalctl --no-pager -u wazuh-indexer.service exit 1 fi - - run: | + - if: endsWith(${{ inputs.package }}, "deb") + run: | if ! sudo systemctl start wazuh-indexer; then sudo journalctl --no-pager -u wazuh-indexer.service exit 1 fi - - run: | + - if: endsWith(${{ inputs.package }}, "deb") + run: | if ! sudo systemctl status --no-pager wazuh-indexer -n 100; then sudo journalctl --no-pager -u wazuh-indexer.service exit 1