|
| 1 | +name: "UTBot Java: night statistics collection" |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '0 0 * * *' |
| 6 | + |
| 7 | +env: |
| 8 | + run_tries: 3 |
| 9 | + run_timeout_minutes: 20 |
| 10 | + output_stats: stats.json |
| 11 | + history_file: monitoring/history.json |
| 12 | + coverage_graph_file: monitoring/coverage_graph.png |
| 13 | + quantitative_graph_file: monitoring/quantitative_graph.png |
| 14 | + KOTLIN_HOME: /usr |
| 15 | + |
| 16 | +jobs: |
| 17 | + build_and_run_monitoring: |
| 18 | + runs-on: ubuntu-20.04 |
| 19 | + steps: |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v3 |
| 22 | + |
| 23 | + - uses: actions/setup-java@v3 |
| 24 | + with: |
| 25 | + java-version: '8' |
| 26 | + distribution: 'zulu' |
| 27 | + java-package: jdk+fx |
| 28 | + - uses: gradle/gradle-build-action@v2 |
| 29 | + with: |
| 30 | + gradle-version: 6.8 |
| 31 | + - uses: actions/setup-python@v4 |
| 32 | + with: |
| 33 | + python-version: '3.9' |
| 34 | + cache: 'pip' |
| 35 | + - name: Install matplotlib |
| 36 | + run: pip install matplotlib |
| 37 | + |
| 38 | + - name: Build and run monitoring UTBot Java |
| 39 | + run: | |
| 40 | + gradle :utbot-junit-contest:monitoringJar |
| 41 | + java -jar utbot-junit-contest/build/libs/monitoring.jar \ |
| 42 | + $output_stats $run_tries $run_timeout_minutes |
| 43 | +
|
| 44 | + - name: Update history and render graphs |
| 45 | + run: | |
| 46 | + python monitoring/draw_stats_graphs.py \ |
| 47 | + $history_file \ |
| 48 | + $output_stats \ |
| 49 | + $coverage_graph_file \ |
| 50 | + $quantitative_graph_file |
| 51 | +
|
| 52 | + - name: Get current date |
| 53 | + id: date |
| 54 | + run: echo "::set-output name=date::$(date +'%d-%m-%Y')" |
| 55 | + |
| 56 | + - name: Commit and push graphs and statistics |
| 57 | + uses: actions-js/push@master |
| 58 | + with: |
| 59 | + message: 'night-monitoring-${{ steps.date.outputs.date }}' |
| 60 | + directory: './monitoring' |
| 61 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + |
| 63 | + - name: Upload logs |
| 64 | + if: ${{ always() }} |
| 65 | + uses: actions/upload-artifact@v3 |
| 66 | + with: |
| 67 | + name: logs |
| 68 | + path: logs/utbot.log |
| 69 | + |
| 70 | + - name: Upload statistics |
| 71 | + if: ${{ success() }} |
| 72 | + uses: actions/upload-artifact@v3 |
| 73 | + with: |
| 74 | + name: statistics |
| 75 | + path: ${{ env.output_stats }} |
0 commit comments