|
| 1 | +name: Generate Test Report Table (Unity) |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: "0 13 * * *" # 1pm UTC = 5am PST / 6am PDT, 6 hours after testapps run |
| 7 | + |
| 8 | +env: |
| 9 | + GITHUB_TOKEN: ${{ github.token }} |
| 10 | + numDays: 7 |
| 11 | + numDaysExtended: 30 |
| 12 | + numTestsSummary: 10 |
| 13 | + |
| 14 | +jobs: |
| 15 | + generate-report: |
| 16 | + runs-on: ubuntu-20.04 |
| 17 | + steps: |
| 18 | + - name: Setup python |
| 19 | + uses: actions/setup-python@v4 |
| 20 | + with: |
| 21 | + python-version: 3.9 |
| 22 | + - uses: actions/checkout@v3 |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + - name: Checkout CPP Repo |
| 26 | + uses: actions/checkout@v3 |
| 27 | + with: |
| 28 | + repository: firebase/firebase-cpp-sdk |
| 29 | + path: firebase-cpp-sdk |
| 30 | + submodules: true |
| 31 | + fetch-depth: 0 |
| 32 | + - name: Install Desktop SDK prerequisites |
| 33 | + uses: nick-invision/retry@v2 |
| 34 | + with: |
| 35 | + timeout_minutes: 15 |
| 36 | + max_attempts: 3 |
| 37 | + command: | |
| 38 | + python3 firebase-cpp-sdk/scripts/gha/install_prereqs_desktop.py --gha_build |
| 39 | + python3 -m pip install requests python-dateutil progress attrs |
| 40 | + - name: Fetch GitHub jobs (with retry) |
| 41 | + uses: nick-invision/retry@v2 |
| 42 | + with: |
| 43 | + timeout_minutes: 20 |
| 44 | + max_attempts: 3 |
| 45 | + shell: bash |
| 46 | + command: python3 firebase-cpp-sdk/scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --write_cache build_status_short.cache |
| 47 | + - name: Fetch extended GitHub jobs (with retry) |
| 48 | + uses: nick-invision/retry@v2 |
| 49 | + with: |
| 50 | + timeout_minutes: 80 |
| 51 | + max_attempts: 3 |
| 52 | + shell: bash |
| 53 | + command: python3 firebase-cpp-sdk/scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --write_cache build_status.cache |
| 54 | + - name: Generate report files |
| 55 | + run: | |
| 56 | + python3 firebase-cpp-sdk/scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --output_markdown --read_cache build_status_short.cache > report_short.md |
| 57 | + python3 firebase-cpp-sdk/scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --output_markdown --read_cache build_status.cache > report_extended.md |
| 58 | + python3 firebase-cpp-sdk/scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --output_markdown --read_cache build_status.cache --report=test_summary --summary_count=${{ env.numTestsSummary }} > test_summary.md |
| 59 | + python3 firebase-cpp-sdk/scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --nooutput_header --read_cache build_status_short.cache > report.txt |
| 60 | + - name: Generate comment string |
| 61 | + run: | |
| 62 | + echo -n > comment.md |
| 63 | + cat >> comment.md <<EOF |
| 64 | + EOF |
| 65 | + cat report_short.md >> comment.md |
| 66 | + cat >> comment.md <<EOF |
| 67 | +
|
| 68 | + <details><summary>View extended history (last ${{ env.numDaysExtended }} days)</summary> |
| 69 | +
|
| 70 | + EOF |
| 71 | + cat report_extended.md >> comment.md |
| 72 | + cat >> comment.md <<EOF |
| 73 | + </details> |
| 74 | + <details><summary>Top ${{ env.numTestsSummary }} flakes/failures (last ${{ env.numDaysExtended }} days)</summary> |
| 75 | +
|
| 76 | + EOF |
| 77 | + cat test_summary.md >> comment.md |
| 78 | + cat >> comment.md <<EOF |
| 79 | + </details> |
| 80 | + <details><summary>📄</summary><pre> |
| 81 | + EOF |
| 82 | + cat report.txt >> comment.md |
| 83 | + cat >> comment.md <<EOF |
| 84 | + </pre></details> |
| 85 | +
|
| 86 | + *** |
| 87 | +
|
| 88 | + EOF |
| 89 | + - name: Show comment string |
| 90 | + run: | |
| 91 | + cat comment.md |
| 92 | + - name: Update GitHub issue (with retry) |
| 93 | + uses: nick-invision/retry@v2 |
| 94 | + with: |
| 95 | + timeout_minutes: 5 |
| 96 | + max_attempts: 3 |
| 97 | + shell: bash |
| 98 | + command: python3 firebase-cpp-sdk/scripts/gha/update_issue_comment.py --token ${{ github.token }} --issue_title '[Unity] Nightly Integration Testing Report' --start_tag build-dashboard-comment-start --end_tag build-dashboard-comment-end < comment.md |
0 commit comments