diff --git a/.github/workflows/tests_results.yml b/.github/workflows/tests_results.yml index 8269125a51f..a51423179c3 100644 --- a/.github/workflows/tests_results.yml +++ b/.github/workflows/tests_results.yml @@ -22,7 +22,12 @@ jobs: statuses: write checks: write pull-requests: write + contents: write steps: + - uses: actions/checkout@v4 + with: + ref: gh-pages + - name: Download and Extract Artifacts uses: dawidd6/action-download-artifact@v6 with: @@ -102,7 +107,31 @@ jobs: repo: repo, sha: sha, state: '${{ job.status }}', - description: '${{ job.status }}' ? 'Runtime tests successful' : 'Runtime tests failed', + description: '${{ job.status }}' == 'success' ? 'Runtime tests successful' : 'Runtime tests failed', target_url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' })).data; core.info(`${name} is ${state}`); + + - name: Create output folder + if: ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} + run: | + rm -rf artifacts + mkdir -p runtime-tests-results + + - name: Generate badge + if: ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} + uses: jaywcjlove/generated-badges@main + with: + label: Runtime Tests + status: ${{ job.status }} + output: runtime-tests-results/badge.svg + color: ${{ job.status == 'success' && 'green' || 'red' }} + + - name: Push badge + if: ${{ !cancelled() && (env.original_event == 'schedule' || env.original_event == 'workflow_dispatch') }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add --all + git commit -m "Updated runtime tests badge" + git push origin HEAD:gh-pages diff --git a/README.md b/README.md index 52d13707db6..fb459a717c3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Arduino core for the ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 and ESP32-H2 -![Build Status](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![External Libraries Test](https://github.com/espressif/arduino-esp32/actions/workflows/lib.yml/badge.svg?branch=master&event=schedule)](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md) [![Hardware Tests](https://github.com/espressif/arduino-esp32/actions/workflows/tests.yml/badge.svg?branch=master&event=schedule)](https://github.com/espressif/arduino-esp32/actions/workflows/tests.yml?query=event%3Aschedule) +![Build Status](https://github.com/espressif/arduino-esp32/workflows/ESP32%20Arduino%20CI/badge.svg) [![External Libraries Test](https://github.com/espressif/arduino-esp32/actions/workflows/lib.yml/badge.svg?branch=master&event=schedule)](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md) [![Hardware Tests](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/badge.svg)](https://github.com/espressif/arduino-esp32/actions/workflows/tests_results.yml) ### Need help or have a question? Join the chat at [Gitter](https://gitter.im/espressif/arduino-esp32) or [open a new Discussion](https://github.com/espressif/arduino-esp32/discussions)