From fd18899dc1f5935ae2ca5d5d86f32fa21f896560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Wed, 6 Mar 2024 20:36:10 +0100 Subject: [PATCH 1/5] Attemtp to automate package's testing --- .github/workflows/build.yml | 6 ++++++ .github/workflows/r_test.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/r_test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c05d48c4a507..87b4352c5528a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,3 +64,9 @@ jobs: architecture: ${{ matrix.architecture }} distribution: ${{ matrix.distribution }} min: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }} + + test: + needs: [version, commit_sha, assemble] + 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 diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml new file mode 100644 index 0000000000000..ba28d75130dc5 --- /dev/null +++ b/.github/workflows/r_test.yml @@ -0,0 +1,34 @@ +name: Test (reusable) + +# This workflow runs when any of the following occur: +# - Run from another workflow +on: + workflow_call: + inputs: + package: + description: "The name of the package to download." + required: true + type: string + +jobs: + r_test: + runs-on: ubuntu-latest + # Permissions to upload the package + permissions: + packages: read + contents: read + steps: + - uses: actions/checkout@v4 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.package }} + path: artifacts/dist + + - name: Run `test.sh` + run: | + dpkg -i "artifacts/dist/${{ inputs.package }}"; + systemctl daemon-reload; + systemctl enable wazuh-indexer.service; + systemctl start wazuh-indexer; + systemctl status wazuh-indexer From 6f01dada952489f4b3a8254e721ccd49bfc0303e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Wed, 6 Mar 2024 21:10:09 +0100 Subject: [PATCH 2/5] Fix typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87b4352c5528a..6a6dfae4fe285 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,4 +69,4 @@ jobs: needs: [version, commit_sha, assemble] 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 }}_amd64_${{ needs.commit_sha.outputs.commit_sha }}.deb \ No newline at end of file From 6e267c16d020e818b957a0d2cb7d66793c4d2ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Wed, 6 Mar 2024 21:36:37 +0100 Subject: [PATCH 3/5] Update setup gradle action --- .github/workflows/r_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/r_build.yml b/.github/workflows/r_build.yml index 299eb8155f735..4c430ce113ad6 100644 --- a/.github/workflows/r_build.yml +++ b/.github/workflows/r_build.yml @@ -40,7 +40,7 @@ jobs: java-version: 11 - name: Setup Gradle - uses: gradle/gradle-build-action@v2.9.0 + uses: gradle/actions/setup-gradle@v3 - name: Run `build.sh` run: | From 767e0af1a3395f25c301c4ca32f0a89f9b4acd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Wed, 6 Mar 2024 21:55:20 +0100 Subject: [PATCH 4/5] Remove file from another PR --- .github/workflows/build.yml | 8 +------- .github/workflows/r_test.yml | 34 ---------------------------------- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 .github/workflows/r_test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a6dfae4fe285..db387671cd0a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,10 +63,4 @@ jobs: with: architecture: ${{ matrix.architecture }} distribution: ${{ matrix.distribution }} - min: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }} - - test: - needs: [version, commit_sha, assemble] - 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 + min: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }} \ No newline at end of file diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml deleted file mode 100644 index ba28d75130dc5..0000000000000 --- a/.github/workflows/r_test.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Test (reusable) - -# This workflow runs when any of the following occur: -# - Run from another workflow -on: - workflow_call: - inputs: - package: - description: "The name of the package to download." - required: true - type: string - -jobs: - r_test: - runs-on: ubuntu-latest - # Permissions to upload the package - permissions: - packages: read - contents: read - steps: - - uses: actions/checkout@v4 - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: ${{ inputs.package }} - path: artifacts/dist - - - name: Run `test.sh` - run: | - dpkg -i "artifacts/dist/${{ inputs.package }}"; - systemctl daemon-reload; - systemctl enable wazuh-indexer.service; - systemctl start wazuh-indexer; - systemctl status wazuh-indexer From 4340f2a9437f11c5ff480009d51121164e3854ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Wed, 6 Mar 2024 21:56:01 +0100 Subject: [PATCH 5/5] Update build.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álex Ruiz --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db387671cd0a5..2c05d48c4a507 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,4 +63,4 @@ jobs: with: architecture: ${{ matrix.architecture }} distribution: ${{ matrix.distribution }} - min: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }} \ No newline at end of file + min: wazuh-indexer-min_${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-${{ matrix.architecture }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.distribution }}