GHA Windows: Propagate exit code from .bat to calling bash script (#70011)
Summary:
The windows 1st shard was silently failing to run (more details here https://github.com/pytorch/pytorch/issues/70010) because the code to run them was never reached. It was silently failing because our CI still returned green for those workflow jobs, because the exit code from the batch script DID NOT PROPAGATE to the calling bash script.
The key here is that even though we have
```
if ERRORLEVEL 1 exit \b 1
```
The exit code 1 was NOT propagating back to the bash script, as the `exit \b 1` was within an `if` statement and the batch script was actually run in a cmd shell, so the bash script win-test.sh continued without erroring. Moving the `exit \b 1` to be standalone fixes it.
More details for this can be found in this stack overflow https://stackoverflow.com/a/55290133
Evidence that now a failure in the .bat would fail the whole job:
https://github.com/pytorch/pytorch/runs/4621483334?check_suite_focus=true
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70011
Reviewed By: malfet
Differential Revision: D33301254
Pulled By: janeyx99
fbshipit-source-id: 6861dbf0f0a34d5baed59f928e34eab15af6f461