Co-authored-by: Bilog WEB3 <155262265+Bilogweb3@users.noreply.github.com> Co-authored-by: Fallengirl <155266340+Fallengirl@users.noreply.github.com> Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: XxAlex74xX <30472093+XxAlex74xX@users.noreply.github.com> Co-authored-by: Arr00 <13561405+arr00@users.noreply.github.com> Co-authored-by: PixelPilot <161360836+PixelPil0t1@users.noreply.github.com> Co-authored-by: kilavvy <140459108+kilavvy@users.noreply.github.com> Co-authored-by: Devkuni <155117116+detrina@users.noreply.github.com> Co-authored-by: Danbo <140512416+dannbbb1@users.noreply.github.com> Co-authored-by: Ann Wagner <chant_77_swirly@icloud.com> Co-authored-by: comfsrt <155266597+comfsrt@users.noreply.github.com> Co-authored-by: Bob <158583129+bouchmann@users.noreply.github.com> Co-authored-by: JohnBonny <158583902+JohnBonny@users.noreply.github.com> Co-authored-by: moonman <155266991+moooonman@users.noreply.github.com> Co-authored-by: kazak <alright-epsilon8h@icloud.com> Co-authored-by: Wei <ybxerlvqtx@rambler.ru> Co-authored-by: Maxim Evtush <154841002+maximevtush@users.noreply.github.com> Co-authored-by: Vitalyr <158586577+Vitaliyr888@users.noreply.github.com> Co-authored-by: pendrue <158588659+pendrue@users.noreply.github.com> Co-authored-by: Tronica <wudmytrotest404@gmail.com> Co-authored-by: emmmm <155267286+eeemmmmmm@users.noreply.github.com> Co-authored-by: bigbear <155267841+aso20455@users.noreply.github.com> Co-authored-by: Tomás Andróil <tomasandroil@gmail.com> Co-authored-by: GooseMatrix <155266802+GooseMatrix@users.noreply.github.com> Co-authored-by: jasmy <3776356370@qq.com> Co-authored-by: SITADRITA1 <mrlime2018@gmail.com> Co-authored-by: Ocenka <testoviydiman1@gmail.com>
52 lines
1.8 KiB
YAML
52 lines
1.8 KiB
YAML
name: Compare gas costs
|
|
description: Compare gas costs between branches
|
|
inputs:
|
|
token:
|
|
description: GitHub token, required to access GitHub API
|
|
required: true
|
|
report:
|
|
description: Path to the report to compare
|
|
required: false
|
|
default: gasReporterOutput.json
|
|
out_report:
|
|
description: Path to save the output report
|
|
required: false
|
|
default: ${{ github.ref_name }}.gasreport.json
|
|
ref_report:
|
|
description: Path to the reference report for comparison
|
|
required: false
|
|
default: ${{ github.base_ref }}.gasreport.json
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Download reference report
|
|
if: github.event_name == 'pull_request'
|
|
run: |
|
|
RUN_ID=`gh run list --repo ${{ github.repository }} --branch ${{ github.base_ref }} --workflow ${{ github.workflow }} --limit 100 --json 'conclusion,databaseId,event' --jq 'map(select(.conclusion=="success" and .event!="pull_request"))[0].databaseId'`
|
|
gh run download ${RUN_ID} --repo ${{ github.repository }} -n gasreport
|
|
env:
|
|
GITHUB_TOKEN: ${{ inputs.token }}
|
|
shell: bash
|
|
continue-on-error: true
|
|
id: reference
|
|
- name: Compare reports
|
|
if: steps.reference.outcome == 'success' && github.event_name == 'pull_request'
|
|
run: |
|
|
node scripts/checks/compareGasReports.js ${{ inputs.report }} ${{ inputs.ref_report }} >> $GITHUB_STEP_SUMMARY
|
|
env:
|
|
STYLE: markdown
|
|
shell: bash
|
|
- name: Rename report for upload
|
|
if: github.event_name != 'pull_request'
|
|
run: |
|
|
mv ${{ inputs.report }} ${{ inputs.out_report }}
|
|
shell: bash
|
|
- name: Save report
|
|
if: github.event_name != 'pull_request'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: gasreport
|
|
overwrite: true
|
|
path: ${{ inputs.out_report }}
|