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 6767
6868 - name : Run the benchmarks
6969 uses : CodSpeedHQ/action@main
70+ env :
71+ MY_ENV_VAR : " YES"
7072 with :
7173 run : cargo codspeed run
7274 token : ${{ secrets.CODSPEED_TOKEN }}
8991
9092 - name : Run the benchmarks
9193 uses : CodSpeedHQ/action@main
94+ env :
95+ MY_ENV_VAR : " YES"
9296 with :
9397 run : cargo codspeed run
9498 token : ${{ secrets.CODSPEED_TOKEN }}
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ harness = false
3333name = " time_scale"
3434harness = false
3535
36+ [[bench ]]
37+ name = " env"
38+ harness = false
39+
3640[[bench ]]
3741name = " the_algorithms"
3842harness = 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