You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,9 +80,10 @@ jobs:
80
80
- run: forge test --gas-report > gasreport.ansi
81
81
82
82
- name: Compare gas reports
83
-
uses: Rubilmax/foundry-gas-diff@v3.7
83
+
uses: Rubilmax/foundry-gas-diff@v3.8
84
84
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
86
87
ignore: test/**/* # optionally filter out gas reports from specific paths
87
88
id: gas_diff
88
89
@@ -100,12 +101,6 @@ jobs:
100
101
101
102
## Options
102
103
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
-
109
104
### `token` _{string}_
110
105
111
106
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
137
132
138
133
_Defaults to: `Changes to gas cost`_
139
134
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[]}_
141
150
142
151
The list of paths from which to ignore gas reports, separated by a comma.
143
152
This allows to clean out gas diffs from dependency contracts impacted by a change (e.g. Proxies, ERC20, ...).
144
153
145
154
_No default assigned: optional opt-in (Please note that node dependencies are always discarded from gas reports)_
146
155
147
-
### `match` _{string}_
156
+
### `match` _{string[]}_
148
157
149
158
The list of paths of which only to keep gas reports, separated by a comma.
150
159
This allows to only display gas diff of specific contracts.
Copy file name to clipboardExpand all lines: action.yml
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,6 @@ branding:
6
6
color: purple
7
7
8
8
inputs:
9
-
workflowId:
10
-
description: The workflow's file name or ID.
11
-
required: true
12
9
token:
13
10
description: The repository's github token.
14
11
default: ${{ github.token }}
@@ -29,6 +26,14 @@ inputs:
29
26
description: The title displayed in the markdown output.
30
27
default: Changes to gas costs
31
28
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
32
37
ignore:
33
38
description: The list of paths from which to ignore gas reports, separated by a comma.
0 commit comments