@@ -17,23 +17,29 @@ jobs:
1717 permissions :
1818 actions : write
1919 runs-on : ubuntu-latest
20+ strategy :
21+ # Keep the matrix even if there is only one branch.
22+ matrix :
23+ branch : [sycl-rel-6_2, sycl-rel-6_3]
2024 steps :
21- - name : Launch
25+ - name : Launch for ${{ matrix.branch }}
2226 env :
2327 GH_TOKEN : ${{ github.token }}
24- # To avoid excessive scheduled runs this script also checks if there are
25- # new commits since the last run - it checks if the latest commit is
26- # older >24h. That means the previous run already tested this commit.
28+ BRANCH : ${{ matrix.branch }}
29+ # To avoid excessive runs this script checks if there are new commits
30+ # since the last run - it checks if the latest commit is older >24h.
31+ # That means the previous run has already tested this commit.
2732 run : |
33+ BRANCH="${{ matrix.branch }}"
2834 if [ "$GITHUB_EVENT_NAME" = "schedule" ]; then
29- latest_commit_time=$(curl -s -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/intel/llvm/commits/sycl-rel-6_2 | jq -r '.commit.committer.date')
35+ latest_commit_time=$(curl -s -H "Authorization: token $GH_TOKEN" https://api.github.com/repos/intel/llvm/commits/{$BRANCH} | jq -r '.commit.committer.date')
3036 echo $latest_commit_time
3137 latest_commit_epoch=$(date -d "$latest_commit_time" +%s)
3238 now_epoch=$(date +%s)
3339 diff=$((now_epoch - latest_commit_epoch))
3440 if [ "$diff" -lt 86400 ]; then
35- gh workflow run sycl-rel-nightly.yml --repo "${GITHUB_REPOSITORY}" --ref sycl-rel-6_2
41+ gh workflow run sycl-rel-nightly.yml --repo "${GITHUB_REPOSITORY}" --ref "${BRANCH}"
3642 fi
3743 else
38- gh workflow run sycl-rel-nightly.yml --repo "${GITHUB_REPOSITORY}" --ref sycl-rel-6_2
44+ gh workflow run sycl-rel-nightly.yml --repo "${GITHUB_REPOSITORY}" --ref "${BRANCH}"
3945 fi
0 commit comments