-
Notifications
You must be signed in to change notification settings - Fork 9.3k
61 lines (51 loc) · 1.72 KB
/
ci_weekly_run_jenkins.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: weekly CI test run
on:
workflow_call:
inputs:
build_count:
required: true
type: string
concurrency:
group: ci-run-${{ inputs.build_count }}-${{ github.ref }}
cancel-in-progress: true
jobs:
jenkins_run:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Create master/runner branches
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b jenkins_test_master
echo "TEST JENKINS MASTER" >> test_jenkins
git add test_jenkins
git commit -m 'master jenkins'
GIT_LFS_SKIP_PUSH=1 git push -f origin jenkins_test_master
git checkout -b jenkins_test_runner
echo "TEST JENKINS RUNNER" >> test_jenkins
git add test_jenkins
git commit -m 'runner jenkins'
GIT_LFS_SKIP_PUSH=1 git push -f origin jenkins_test_runner
- name: Waiting on Jenkins runs
uses: actions/github-script@v6
with:
script: |
let prev_status = false;
const interval setInterval(() => {
const response = github.request('GET /repos/{owner}/{repo}/commits/{ref}/status', {
owner: 'commaai',
repo: 'openpilot',
ref: 'heads/jenkins_test_master',
headers: {
'Accept': 'application/vnd.github+json',
'X-GitHub-Api-Version': '2022-11-28'
}
});
response.then(function(r) {
if (r.data.statuses[0].state != "pending") {
clearInterval(interval)
}
});
}, 60000);