This is not possible via the action DSL at the moment, you need to use a shell command: (system "my_proj_exe < test.txt"). Although, it seems like a (with-stdin-from <file> <action>) construction would be a fine addition since we already have (with-stdout-to <file> <action>).
BTW, calling dune exec here feels a bit odd, why not do (run my_proj_exe ...) directly?