Skip to content

Commit

Permalink
Add testing of RPM packages
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRuiz7 committed Mar 7, 2024
1 parent 1e5133b commit ba80f53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 }}
20 changes: 16 additions & 4 deletions .github/workflows/r_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ba80f53

Please sign in to comment.