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