File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
crates/divan_compat/examples Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 67
67
68
68
- name : Run the benchmarks
69
69
uses : CodSpeedHQ/action@main
70
+ env :
71
+ MY_ENV_VAR : " YES"
70
72
with :
71
73
run : cargo codspeed run
72
74
token : ${{ secrets.CODSPEED_TOKEN }}
89
91
90
92
- name : Run the benchmarks
91
93
uses : CodSpeedHQ/action@main
94
+ env :
95
+ MY_ENV_VAR : " YES"
92
96
with :
93
97
run : cargo codspeed run
94
98
token : ${{ secrets.CODSPEED_TOKEN }}
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ harness = false
33
33
name = " time_scale"
34
34
harness = false
35
35
36
+ [[bench ]]
37
+ name = " env"
38
+ harness = false
39
+
36
40
[[bench ]]
37
41
name = " the_algorithms"
38
42
harness = false
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ divan:: main ( ) ;
3
+ }
4
+
5
+ #[ divan:: bench]
6
+ fn print_env_hello ( ) {
7
+ let env_var = std:: env:: var ( "MY_ENV_VAR" ) . unwrap_or ( "not set" . to_string ( ) ) ;
8
+ println ! ( "MY_ENV_VAR is {}" , env_var) ;
9
+ }
You can’t perform that action at this time.
0 commit comments