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 01/21] 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 02/21] 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 a6da6951ad460fb329196ee10414d81e73857753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Wed, 6 Mar 2024 21:42:37 +0100 Subject: [PATCH 03/21] Add sudo --- .github/workflows/r_test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index ba28d75130dc5..5b3ca8f64957f 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -27,8 +27,8 @@ jobs: - 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 + sudo dpkg -i "artifacts/dist/${{ inputs.package }}"; + sudo systemctl daemon-reload; + sudo systemctl enable wazuh-indexer.service; + sudo systemctl start wazuh-indexer; + sudo systemctl status wazuh-indexer From c4386e2f70737cacfbd78036c4cb99243b76ce61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Wed, 6 Mar 2024 22:22:07 +0100 Subject: [PATCH 04/21] Split test steps and manage errors --- .github/workflows/r_test.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 5b3ca8f64957f..e2bf0b807aca3 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -25,10 +25,11 @@ jobs: name: ${{ inputs.package }} path: artifacts/dist - - name: Run `test.sh` + - name: Install package run: | - sudo dpkg -i "artifacts/dist/${{ inputs.package }}"; - sudo systemctl daemon-reload; - sudo systemctl enable wazuh-indexer.service; - sudo systemctl start wazuh-indexer; - sudo systemctl status wazuh-indexer + sudo dpkg -i "artifacts/dist/${{ inputs.package }}" + + - run: sudo systemctl daemon-reload + - run: sudo systemctl enable wazuh-indexer.service || sudo journalctl -xeu wazuh-indexer.service + - run: sudo systemctl start wazuh-indexer || sudo journalctl -xeu wazuh-indexer.service + - run: sudo systemctl status wazuh-indexer \ No newline at end of file From 420645c2963315b414f07668a2c4029de7142c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Wed, 6 Mar 2024 22:45:05 +0100 Subject: [PATCH 05/21] Add --no-pager to journalctl --- .github/workflows/r_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index e2bf0b807aca3..7623ead1b125e 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -30,6 +30,6 @@ jobs: sudo dpkg -i "artifacts/dist/${{ inputs.package }}" - run: sudo systemctl daemon-reload - - run: sudo systemctl enable wazuh-indexer.service || sudo journalctl -xeu wazuh-indexer.service - - run: sudo systemctl start wazuh-indexer || sudo journalctl -xeu wazuh-indexer.service + - run: sudo systemctl enable wazuh-indexer.service || sudo journalctl --no-pager -u wazuh-indexer.service + - run: sudo systemctl start wazuh-indexer || sudo journalctl --no-pager -u wazuh-indexer.service - run: sudo systemctl status wazuh-indexer \ No newline at end of file From 0b65319b9bfc004a62943f46dab02cf097d56281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 12:56:32 +0100 Subject: [PATCH 06/21] Add certs generator --- .github/workflows/r_test.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 7623ead1b125e..3eddf890b776e 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -18,7 +18,6 @@ jobs: packages: read contents: read steps: - - uses: actions/checkout@v4 - name: Download artifact uses: actions/download-artifact@v4 with: @@ -29,7 +28,26 @@ jobs: run: | sudo dpkg -i "artifacts/dist/${{ inputs.package }}" + - uses: actions/checkout@v4 + - name: Generate and deploy certificates + uses: addnab/docker-run-action@v3 + with: + image: wazuh/wazuh-certs-generator:0.0.1 + options: -v ${{ github.workspace }}/integrations/docker/config/certs.yml:/config/certs.yml -v /etc/wazuh-indexer/certs:/certs + shell: sh + run: | + mkdir -p /certificates /certs + /entrypoint.sh + chown -R 1000:999 /certificates + chmod 740 /certificates + chmod 440 /certificates/* + + mv /certificates/wazuh.indexer-key.pem /certs/indexer-key.pem + mv /certificates/wazuh.indexer.pem /certs/indexer.pem + mv /certificates/root-ca.pem /certs/root-ca.pem + ls /certs + - run: sudo systemctl daemon-reload - - run: sudo systemctl enable wazuh-indexer.service || sudo journalctl --no-pager -u wazuh-indexer.service - - run: sudo systemctl start wazuh-indexer || sudo journalctl --no-pager -u wazuh-indexer.service - - run: sudo systemctl status wazuh-indexer \ No newline at end of file + - run: sudo systemctl enable wazuh-indexer.service || sudo journalctl --no-pager -u wazuh-indexer.service && exit 1 + - run: sudo systemctl start wazuh-indexer || sudo journalctl --no-pager -u wazuh-indexer.service && exit 1 + - run: sudo systemctl status wazuh-indexer || sudo journalctl --no-pager -u wazuh-indexer.service && exit 1 From 335691f365d5152c592e817c96a49695363bad57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 13:33:21 +0100 Subject: [PATCH 07/21] Improve error handling --- .github/workflows/r_test.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 3eddf890b776e..bb1e565a34159 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -36,18 +36,30 @@ jobs: options: -v ${{ github.workspace }}/integrations/docker/config/certs.yml:/config/certs.yml -v /etc/wazuh-indexer/certs:/certs shell: sh run: | - mkdir -p /certificates /certs + mkdir -p /certificates /certs /entrypoint.sh chown -R 1000:999 /certificates chmod 740 /certificates chmod 440 /certificates/* - + mv /certificates/wazuh.indexer-key.pem /certs/indexer-key.pem mv /certificates/wazuh.indexer.pem /certs/indexer.pem mv /certificates/root-ca.pem /certs/root-ca.pem ls /certs - run: sudo systemctl daemon-reload - - run: sudo systemctl enable wazuh-indexer.service || sudo journalctl --no-pager -u wazuh-indexer.service && exit 1 - - run: sudo systemctl start wazuh-indexer || sudo journalctl --no-pager -u wazuh-indexer.service && exit 1 - - run: sudo systemctl status wazuh-indexer || sudo journalctl --no-pager -u wazuh-indexer.service && exit 1 + - run: | + if sudo systemctl enable wazuh-indexer.service; then + sudo journalctl --no-pager -u wazuh-indexer.service + exit 1 + fi + - run: | + if sudo systemctl start wazuh-indexer; then + sudo journalctl --no-pager -u wazuh-indexer.service + exit 1 + fi + - run: | + if sudo systemctl status wazuh-indexer; then + sudo journalctl --no-pager -u wazuh-indexer.service + exit 1 + fi From 1acd27e7dfe22a9eb826fa2af419bbb1c2b414c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 13:59:52 +0100 Subject: [PATCH 08/21] Update r_test.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix indentation Signed-off-by: Álex Ruiz --- .github/workflows/r_test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index bb1e565a34159..6adabacdc1fcf 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -54,12 +54,12 @@ jobs: exit 1 fi - run: | - if sudo systemctl start wazuh-indexer; then - sudo journalctl --no-pager -u wazuh-indexer.service - exit 1 - fi + if sudo systemctl start wazuh-indexer; then + sudo journalctl --no-pager -u wazuh-indexer.service + exit 1 + fi - run: | - if sudo systemctl status wazuh-indexer; then - sudo journalctl --no-pager -u wazuh-indexer.service - exit 1 - fi + if sudo systemctl status wazuh-indexer; then + sudo journalctl --no-pager -u wazuh-indexer.service + exit 1 + fi From 1e5133bda34cd67c7dc84a887bc4b7835dcba177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 14:38:38 +0100 Subject: [PATCH 09/21] Fix error handling --- .github/workflows/r_test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 6adabacdc1fcf..648b37bf20bda 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -49,17 +49,17 @@ jobs: - run: sudo systemctl daemon-reload - run: | - if sudo systemctl enable wazuh-indexer.service; then - sudo journalctl --no-pager -u wazuh-indexer.service - exit 1 + if ! sudo systemctl enable wazuh-indexer.service; then + sudo journalctl --no-pager -u wazuh-indexer.service + exit 1 fi - run: | - if sudo systemctl start wazuh-indexer; then + if ! sudo systemctl start wazuh-indexer; then sudo journalctl --no-pager -u wazuh-indexer.service exit 1 fi - run: | - if sudo systemctl status wazuh-indexer; then + if ! sudo systemctl status --no-pager wazuh-indexer -n 100; then sudo journalctl --no-pager -u wazuh-indexer.service exit 1 fi 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 10/21] 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 From 92198c52ab05f98cad05100480c8c4ff58b8d4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 17:13:20 +0100 Subject: [PATCH 11/21] Improve multi-os testing --- .github/workflows/build.yml | 8 ++++---- .github/workflows/r_test.yml | 35 +++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ecabc5404f70..2dde1ec664ed1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: push: # Sequence of patterns matched against refs/heads branches: - - 'ci/*' + - "ci/*" workflow_dispatch: inputs: revision: @@ -36,7 +36,7 @@ jobs: uses: ./.github/workflows/r_commit_sha.yml build: - needs: [ version, commit_sha ] + needs: [version, commit_sha] strategy: matrix: distribution: [tar, rpm, deb] @@ -69,7 +69,7 @@ jobs: needs: [version, commit_sha, assemble] strategy: matrix: - os: [ {suffix: "amd64", ext: "deb"}, {suffix: "x86_64", ext: "rpm"} ] + 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 }}_${{ matrix.os.suffix }}_${{ needs.commit_sha.outputs.commit_sha }}.${{ matrix.os.ext }} \ 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 }} diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 5dc38ea8972fa..56277c2ae903f 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -11,7 +11,8 @@ on: type: string jobs: - r_test: + r_test_rpm: + if: endsWith(${{ inputs.package }}, "rpm") runs-on: ubuntu-latest # Permissions to upload the package permissions: @@ -24,20 +25,30 @@ jobs: name: ${{ inputs.package }} path: artifacts/dist - - name: Install package (RPM) - if: endsWith(${{ inputs.package }}, "rpm") + - name: Install package run: | sudo yum localinstall "artifacts/dist/${{ inputs.package }}" - - name: Install package (DEB) - if: endsWith(${{ inputs.package }}, "deb") + r_test_deb: + if: endsWith(${{ inputs.package }}, "deb") + runs-on: ubuntu-latest + # Permissions to upload the package + permissions: + packages: read + contents: read + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.package }} + path: artifacts/dist + + - name: Install package 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 @@ -56,21 +67,17 @@ jobs: ls /certs - run: sudo systemctl daemon-reload - if: endsWith(${{ inputs.package }}, "deb") - - if: endsWith(${{ inputs.package }}, "deb") - run: | + - run: | if ! sudo systemctl enable wazuh-indexer.service; then sudo journalctl --no-pager -u wazuh-indexer.service exit 1 fi - - if: endsWith(${{ inputs.package }}, "deb") - run: | + - run: | if ! sudo systemctl start wazuh-indexer; then sudo journalctl --no-pager -u wazuh-indexer.service exit 1 fi - - if: endsWith(${{ inputs.package }}, "deb") - run: | + - run: | if ! sudo systemctl status --no-pager wazuh-indexer -n 100; then sudo journalctl --no-pager -u wazuh-indexer.service exit 1 From e7efdbf728fd9fa54862cb8429472ddce701c4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 17:15:05 +0100 Subject: [PATCH 12/21] Add TEST env var --- .github/workflows/r_assemble.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/r_assemble.yml b/.github/workflows/r_assemble.yml index d08b64cea23ed..11009429298e0 100644 --- a/.github/workflows/r_assemble.yml +++ b/.github/workflows/r_assemble.yml @@ -1,5 +1,8 @@ name: Assemble (reusable) +env: + TEST: true + # This workflow runs when any of the following occur: # - Run from another workflow on: From 76df4566f7e4f0572da45e85f901350d872c5a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 17:41:31 +0100 Subject: [PATCH 13/21] Add braces to if conditionals --- .github/workflows/r_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 56277c2ae903f..325a502ced689 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -12,7 +12,7 @@ on: jobs: r_test_rpm: - if: endsWith(${{ inputs.package }}, "rpm") + if: ${{ endsWith(${{ inputs.package }}, "rpm") }} runs-on: ubuntu-latest # Permissions to upload the package permissions: @@ -30,7 +30,7 @@ jobs: sudo yum localinstall "artifacts/dist/${{ inputs.package }}" r_test_deb: - if: endsWith(${{ inputs.package }}, "deb") + if: ${{ endsWith(${{ inputs.package }}, "deb") }} runs-on: ubuntu-latest # Permissions to upload the package permissions: From eb0bc96d91514ac73633baf0b6ba6ec46f481ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 17:44:57 +0100 Subject: [PATCH 14/21] Remove all curly braches from if conditionals --- .github/workflows/r_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 325a502ced689..cd831be987e41 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -12,7 +12,7 @@ on: jobs: r_test_rpm: - if: ${{ endsWith(${{ inputs.package }}, "rpm") }} + if: endsWith(inputs.package, "rpm") runs-on: ubuntu-latest # Permissions to upload the package permissions: @@ -30,7 +30,7 @@ jobs: sudo yum localinstall "artifacts/dist/${{ inputs.package }}" r_test_deb: - if: ${{ endsWith(${{ inputs.package }}, "deb") }} + if: endsWith(inputs.package, "deb") runs-on: ubuntu-latest # Permissions to upload the package permissions: From b3af2ac81469dcd280550468942a44e232ddf0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 17:47:59 +0100 Subject: [PATCH 15/21] braces again --- .github/workflows/r_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index cd831be987e41..a0b3c7508a1ed 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -12,7 +12,7 @@ on: jobs: r_test_rpm: - if: endsWith(inputs.package, "rpm") + if: ${{ endsWith(inputs.package, 'rpm') }} runs-on: ubuntu-latest # Permissions to upload the package permissions: @@ -30,7 +30,7 @@ jobs: sudo yum localinstall "artifacts/dist/${{ inputs.package }}" r_test_deb: - if: endsWith(inputs.package, "deb") + if: ${{ endsWith(inputs.package, 'deb') }} runs-on: ubuntu-latest # Permissions to upload the package permissions: From ccf8f340c2c2149daedc087156fce1af972621a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 18:09:54 +0100 Subject: [PATCH 16/21] Install RPM package in Docker --- .github/workflows/r_test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index a0b3c7508a1ed..bfbb8e987e17d 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -26,8 +26,11 @@ jobs: path: artifacts/dist - name: Install package - run: | - sudo yum localinstall "artifacts/dist/${{ inputs.package }}" + uses: addnab/docker-run-action@v3 + with: + image: redhat/ubi9:latest + run: | + sudo yum localinstall "artifacts/dist/${{ inputs.package }}" r_test_deb: if: ${{ endsWith(inputs.package, 'deb') }} From 073b77bcebf517467a76bfd73b4ef55d845dba78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 18:29:34 +0100 Subject: [PATCH 17/21] Remove sudo for RPM installation --- .github/workflows/build.yml | 1 + .github/workflows/r_test.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2dde1ec664ed1..d045b5d4fb103 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,6 +68,7 @@ jobs: test: needs: [version, commit_sha, assemble] strategy: + fail-fast: false matrix: os: [{ suffix: "amd64", ext: "deb" }, { suffix: "x86_64", ext: "rpm" }] uses: ./.github/workflows/r_test.yml diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index bfbb8e987e17d..ae0269cd9c652 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -30,7 +30,7 @@ jobs: with: image: redhat/ubi9:latest run: | - sudo yum localinstall "artifacts/dist/${{ inputs.package }}" + yum localinstall "artifacts/dist/${{ inputs.package }}" r_test_deb: if: ${{ endsWith(inputs.package, 'deb') }} From 750a89d0600620382c8cb318f9a9951b37143c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 18:50:54 +0100 Subject: [PATCH 18/21] Bind artifacts/dist to RPM docker test container --- .github/workflows/r_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index ae0269cd9c652..cec3ac0813046 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -29,6 +29,7 @@ jobs: uses: addnab/docker-run-action@v3 with: image: redhat/ubi9:latest + options: -v ${{ github.workspace }}/artifacts/dist -v /artifacts/dist run: | yum localinstall "artifacts/dist/${{ inputs.package }}" From 6d664a4b87837dbc4db85ad6c82a213d5b0ab6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 18:51:14 +0100 Subject: [PATCH 19/21] Bind artifacts/dist to RPM docker test container --- .github/workflows/r_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index cec3ac0813046..e7297d93cd280 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -31,7 +31,7 @@ jobs: image: redhat/ubi9:latest options: -v ${{ github.workspace }}/artifacts/dist -v /artifacts/dist run: | - yum localinstall "artifacts/dist/${{ inputs.package }}" + yum localinstall "/artifacts/dist/${{ inputs.package }}" r_test_deb: if: ${{ endsWith(inputs.package, 'deb') }} From 6b04cc2f0d5c36527604ab06be54b0253ad7a02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 19:10:09 +0100 Subject: [PATCH 20/21] Avoid prompt during yum install --- .github/workflows/r_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index e7297d93cd280..89a77ac5cab94 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -31,7 +31,7 @@ jobs: image: redhat/ubi9:latest options: -v ${{ github.workspace }}/artifacts/dist -v /artifacts/dist run: | - yum localinstall "/artifacts/dist/${{ inputs.package }}" + yum localinstall "/artifacts/dist/${{ inputs.package }}" -y r_test_deb: if: ${{ endsWith(inputs.package, 'deb') }} From 14e457a6d4a4acc2f3c778ce30918d2f9df5bc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 7 Mar 2024 19:38:58 +0100 Subject: [PATCH 21/21] Fix bind volume --- .github/workflows/r_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/r_test.yml b/.github/workflows/r_test.yml index 89a77ac5cab94..fa9cd819ac8fe 100644 --- a/.github/workflows/r_test.yml +++ b/.github/workflows/r_test.yml @@ -29,7 +29,7 @@ jobs: uses: addnab/docker-run-action@v3 with: image: redhat/ubi9:latest - options: -v ${{ github.workspace }}/artifacts/dist -v /artifacts/dist + options: -v ${{ github.workspace }}/artifacts/dist:/artifacts/dist run: | yum localinstall "/artifacts/dist/${{ inputs.package }}" -y