@@ -17,23 +17,29 @@ jobs:
17
17
permissions :
18
18
actions : write
19
19
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]
20
24
steps :
21
- - name : Launch
25
+ - name : Launch for ${{ matrix.branch }}
22
26
env :
23
27
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.
27
32
run : |
33
+ BRANCH="${{ matrix.branch }}"
28
34
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')
30
36
echo $latest_commit_time
31
37
latest_commit_epoch=$(date -d "$latest_commit_time" +%s)
32
38
now_epoch=$(date +%s)
33
39
diff=$((now_epoch - latest_commit_epoch))
34
40
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}"
36
42
fi
37
43
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}"
39
45
fi
0 commit comments