Skip to content

Commit fef15ac

Browse files
committed
⚡️ Speed up artifact searching
1 parent 91fe923 commit fef15ac

File tree

11 files changed

+4720
-360
lines changed

11 files changed

+4720
-360
lines changed

README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ jobs:
8080
- run: forge test --gas-report > gasreport.ansi
8181

8282
- name: Compare gas reports
83-
uses: Rubilmax/foundry-gas-diff@v3.7
83+
uses: Rubilmax/foundry-gas-diff@v3.8
8484
with:
85-
workflowId: foundry-gas-diff.yml # must be the name of the workflow file
85+
sortCriteria: avg,max # optionnally sort diff rows by criteria
86+
sortOrders: desc,asc # and directions
8687
ignore: test/**/* # optionally filter out gas reports from specific paths
8788
id: gas_diff
8889

@@ -100,12 +101,6 @@ jobs:
100101
101102
## Options
102103
103-
### `workflowId` _{string}_ (required)
104-
105-
The workflow ID the reference gas report was uploaded from.
106-
By default, the reference gas report of next workflow runs are uploaded by this action from the previous workflow runs,
107-
thus it should correspond to the ID of the workflow this action is defined in: `foundry-gas-diff.yml` in the above example.
108-
109104
### `token` _{string}_
110105

111106
The github token allowing the action to upload and download gas reports generated by foundry. You should not need to customize this, as the action already has access to the default Github Action token.
@@ -137,14 +132,28 @@ The title displayed in the markdown output. Can be used to identify multiple gas
137132

138133
_Defaults to: `Changes to gas cost`_
139134

140-
### `ignore` _{string}_
135+
### `sortCriteria` _{string[]}_
136+
137+
A list of criteria to sort diff rows by in the report table (can be `name | min | avg | median | max | calls`), separated by a comma.
138+
Must have the same length as sortOrders.
139+
140+
_Defaults to: name_
141+
142+
### `sortOrders` _{string[]}_
143+
144+
A list of directions to sort diff rows by in the report table (can be `asc | desc`), for each sort criterion, separated by a comma.
145+
Must have the same length as sortCriteria.
146+
147+
_Defaults to: asc_
148+
149+
### `ignore` _{string[]}_
141150

142151
The list of paths from which to ignore gas reports, separated by a comma.
143152
This allows to clean out gas diffs from dependency contracts impacted by a change (e.g. Proxies, ERC20, ...).
144153

145154
_No default assigned: optional opt-in (Please note that node dependencies are always discarded from gas reports)_
146155

147-
### `match` _{string}_
156+
### `match` _{string[]}_
148157

149158
The list of paths of which only to keep gas reports, separated by a comma.
150159
This allows to only display gas diff of specific contracts.

action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ branding:
66
color: purple
77

88
inputs:
9-
workflowId:
10-
description: The workflow's file name or ID.
11-
required: true
129
token:
1310
description: The repository's github token.
1411
default: ${{ github.token }}
@@ -29,6 +26,14 @@ inputs:
2926
description: The title displayed in the markdown output.
3027
default: Changes to gas costs
3128
required: false
29+
sortCriteria:
30+
description: The list of criteria to order diff rows by in the report (name | min | avg | median | max | calls), separated by a comma. Must have the same length as sortOrders.
31+
required: false
32+
default: name
33+
sortOrders:
34+
description: The list of directions to order diff rows in the report, according to order criteria (asc | desc), separated by a comma. Must have the same length as sortCriteria.
35+
required: false
36+
default: asc
3237
ignore:
3338
description: The list of paths from which to ignore gas reports, separated by a comma.
3439
required: false

0 commit comments

Comments
 (0)