From 7e6a46465d63f15eb7ca0d741deecdf98bd6c85e Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 23 Feb 2024 11:18:18 +0100 Subject: [PATCH 1/2] release-test.yml: return of the Matrix notification This time keep-it-simple-style with just a cURL command, using the [API `m.room.message`](https://spec.matrix.org/latest/client-server-api/#events-2). --- .github/workflows/release-test.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index 17a6d16cbcea..dac9c96b3ab5 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -130,6 +130,7 @@ jobs: sudo apt-get update sudo apt-get install lib32asan6 - name: Run release tests + id: tests timeout-minutes: 350 run: | RIOTBASE="$GITHUB_WORKSPACE/RIOT" @@ -181,6 +182,25 @@ jobs: mkdir test-reports/ junit2html ${REPORT_XML} ${REPORT_NAME}.html cp ${REPORT_XML} ${REPORT_NAME}.xml + - name: Generate result message + if: always() + id: generate_results + run: | + if [ "${{ steps.tests.conclusion }}" == "success" ]; then + nice_str="✅ PASSED" + elif [ "${{ steps.tests.conclusion }}" == "failure" ]; then + nice_str="❌ FAILED" + fi + echo "nice_str=${nice_str}" >> ${GITHUB_OUTPUT} + - name: Report to Matrix channel + if: ${{ always() && steps.generate_results.outputs.nice_str != '' }} + run: | + MESSAGE="${{ steps.generate_results.outputs.nice_str}}: Release tests" \ + "[${{ matrix.pytest_mark }}, ${{ matrix.sudo }}] on '${{ github.event_name }}':" \ + "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"; \ + curl -H "Content-Type: application/json" -X POST \ + --data '{"msgtype":"m.text","format":"org.matrix.custom.html","body":"${MESSAGE}","formatted_body":"${MESSAGE}"}' \ + "https://matrix.org/_matrix/client/v3/rooms/${{env.RIOT_CI_RELEASE_REPORT_CHANNEL}}/send/m.room.message?access_token=${{secrets.MATRIX_RIOT_CI_ACCESS_TOKEN}}" - uses: actions/upload-artifact@v2 if: always() with: From aafb9abb8bc7f332f6b2e8cb7a17771c0cf8c621 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 23 Feb 2024 12:25:49 +0100 Subject: [PATCH 2/2] release-test.yml: use s3krit's matrix action --- .github/workflows/release-test.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index dac9c96b3ab5..f80cbaa382c5 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -187,20 +187,22 @@ jobs: id: generate_results run: | if [ "${{ steps.tests.conclusion }}" == "success" ]; then - nice_str="✅ PASSED" + nice_str="✅ **PASSED**" elif [ "${{ steps.tests.conclusion }}" == "failure" ]; then - nice_str="❌ FAILED" + nice_str="❌ **FAILED**" fi echo "nice_str=${nice_str}" >> ${GITHUB_OUTPUT} - name: Report to Matrix channel if: ${{ always() && steps.generate_results.outputs.nice_str != '' }} - run: | - MESSAGE="${{ steps.generate_results.outputs.nice_str}}: Release tests" \ - "[${{ matrix.pytest_mark }}, ${{ matrix.sudo }}] on '${{ github.event_name }}':" \ - "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"; \ - curl -H "Content-Type: application/json" -X POST \ - --data '{"msgtype":"m.text","format":"org.matrix.custom.html","body":"${MESSAGE}","formatted_body":"${MESSAGE}"}' \ - "https://matrix.org/_matrix/client/v3/rooms/${{env.RIOT_CI_RELEASE_REPORT_CHANNEL}}/send/m.room.message?access_token=${{secrets.MATRIX_RIOT_CI_ACCESS_TOKEN}}" + uses: s3krit/matrix-message-action@v0.0.3 + with: + room_id: ${{ secrets.RIOT_CI_RELEASE_REPORT_CHANNEL }} + access_token: ${{ secrets.MATRIX_RIOT_CI_ACCESS_TOKEN }} + server: "matrix.org" + message: > + ${{ steps.generate_results.outputs.nice_str}}: Release tests + `[${{ join(matrix.*, ', ') }}]` on `${{ github.event_name }}`: + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - uses: actions/upload-artifact@v2 if: always() with: