-
Notifications
You must be signed in to change notification settings - Fork 56
88 lines (81 loc) · 3.08 KB
/
performance_comparison.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: 'Performance Comparison'
on:
pull_request:
jobs:
comparison:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
- uses: actions/checkout@v1
- name: Run Perfomance Test Main
run: |
julia --project=test -e 'using Pkg; Pkg.add(PackageSpec(name="PowerSimulations", rev="main")); Pkg.instantiate()'
julia -t 4 --project=test test/performance/performance_test.jl "Main"
- name: Run Perfomance Test Branch
run: |
julia --project=test -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
julia -t 4 --project=test test/performance/performance_test.jl "This Branch"
- name: Read precompile results
id: precompile_results
run: |
body="$(cat precompile_time.txt)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=body::$body"
- name: Read build results
id: build_results
run: |
body="$(cat build_time.txt)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=body::$body"
- name: Read solve results
id: solve_results
run: |
body="$(cat solve_time.txt)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=body::$body"
- name: Find Comment
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Performance Results
- name: Create comment
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Performance Results
| Version | Precompile Time |
| :--- | :----: |
${{ steps.precompile_results.outputs.body }}
| Version | Build Time |
| :--- | :----: |
${{ steps.build_results.outputs.body }}
| Version | Solve Time |
| :--- | :----: |
${{ steps.solve_results.outputs.body }}
- name: Update comment
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
Performance Results
| Version | Precompile Time |
| :--- | :----: |
${{ steps.precompile_results.outputs.body }}
| Version | Build Time |
| :--- | :----: |
${{ steps.build_results.outputs.body }}
| Version | Build Time |
| :--- | :----: |
${{ steps.solve_results.outputs.body }}
edit-mode: replace