Skip to content

Commit

Permalink
ci: twister: do not fail if there are no artifacts
Browse files Browse the repository at this point in the history
Do not fail if we can't download any artifacts, i.e. when job is
cancelled.

Only publish on push/schedule

Signed-off-by: Anas Nashif <[email protected]>
  • Loading branch information
nashif committed Nov 20, 2024
1 parent 1be5c15 commit 54ce42b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/twister-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:

jobs:
upload-to-elasticsearch:
if: github.repository == 'zephyrproject-rtos/zephyr'
if: |
github.repository == 'zephyrproject-rtos/zephyr' &&
github.event.workflow_run.event != 'pull_request_target'
env:
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
Expand All @@ -25,13 +27,16 @@ jobs:
persist-credentials: false

- name: Download Artifacts
id: download-artifacts
uses: dawidd6/action-download-artifact@v6
with:
path: artifacts
workflow: twister.yml
run_id: ${{ github.event.workflow_run.id }}
if_no_artifact_found: ignore

- name: Upload to elasticsearch
if: steps.download-artifacts.outputs.found_artifact == 'true'
run: |
pip3 install elasticsearch
# set run date on upload to get consistent and unified data across the matrix.
Expand Down

0 comments on commit 54ce42b

Please sign in to comment.