Skip to content

[CI][sycl-rel] Update scheduled launch #19024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/sycl-rel-nightly-launch.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Gihub Actions launch scheduled workflows of the main branch only (sycl).
# Github Actions launch scheduled workflows of the main branch only (sycl).
# This is a workaround to set a scheduled launch of the sycl-rel-nightly.yml
# workflow, which is located on the sycl-rel-* branch.

Expand All @@ -7,10 +7,8 @@ name: Scheduled sycl-rel-nightly launch
permissions: read-all

on:
# The sycl-rel-nightly.yml workflow file on the sycl-rel-6_2 branch is most
# likely stale. Do not schedule before it's updated.
# schedule:
# - cron: '0 3 * * *'
schedule:
- cron: '0 3 * * *'
workflow_dispatch:

jobs:
Expand All @@ -23,5 +21,19 @@ jobs:
- name: Launch
env:
GH_TOKEN: ${{ github.token }}
# To avoid excessive scheduled runs this script also checks if there are
# new commits since the last run - it checks if the latest commit is
# older >24h. That means the previous run already tested this commit.
run: |
gh workflow run sycl-rel-nightly.yml --repo ${{ github.repository }} --ref sycl-rel-6_2
if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then
latest_commit_time=$(curl -s https://api.github.com/repos/intel/llvm/commits/sycl-rel-6_2 | jq -r '.commit.committer.date')
echo $latest_commit_time
latest_commit_epoch=$(date -d "$latest_commit_time" +%s)
now_epoch=$(date +%s)
diff=$((now_epoch - latest_commit_epoch))
if [ "$diff" -lt 86400 ]; then
gh workflow run sycl-rel-nightly.yml --repo "${GITHUB_REPOSITORY}" --ref sycl-rel-6_2
fi
else
gh workflow run sycl-rel-nightly.yml --repo "${GITHUB_REPOSITORY}" --ref sycl-rel-6_2
fi