Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-desroches committed Oct 17, 2024
1 parent b827835 commit 4ad1d7a
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/ci_weekly_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,23 @@ jobs:
matrix=$(python3 -c "import json; print(json.dumps({ 'run_number' : list(range(${{ env.CI_RUNS }})) }))")
echo "matrix=$matrix" >> $GITHUB_OUTPUT
ci_matrix_run:
ci_matrix_jenkins_run:
needs: [ setup ]
uses: commaai/openpilot/.github/workflows/ci_weekly_run_jenkins.yaml@master
with:
build_count: ${{ env.CI_RUNS }}

ci_matrix_github_actions_run:
needs: [ setup ]
strategy:
fail-fast: false
matrix: ${{fromJSON(needs.setup.outputs.ci_runs)}}
uses: commaai/openpilot/.github/workflows/ci_weekly_run.yaml@master
uses: commaai/openpilot/.github/workflows/ci_weekly_run_github_actions.yaml@master
with:
run_number: ${{ matrix.run_number }}

report:
needs: [ci_matrix_run]
needs: [ci_matrix_jenkins_run, ci_matrix_github_actions_run]
runs-on: ubuntu-latest
if: always()
steps:
Expand Down Expand Up @@ -75,6 +81,7 @@ jobs:
JOB_RESULTS: ${{ fromJSON(steps.get-job-results.outputs.result) }}
run: |
cat <<EOF >> template.html
## Github Actions CI
<table>
<thead>
<tr>
Expand All @@ -99,3 +106,4 @@ jobs:
echo $JOB_RESULTS | jinja2 template.html > report.html
echo "# CI Test Report - ${{ env.CI_RUNS }} Runs" >> $GITHUB_STEP_SUMMARY
cat report.html >> $GITHUB_STEP_SUMMARY
curl https://raw.githubusercontent.com/commaai/ci-artifacts/refs/heads/jenkins_test_report/jenkins_report >> $GITHUB_STEP_SUMMARY
File renamed without changes.
59 changes: 59 additions & 0 deletions .github/workflows/ci_weekly_run_jenkins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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

- 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);

0 comments on commit 4ad1d7a

Please sign in to comment.