Jd/ts cf updates psy4 #602
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |