Use CircleCI commands for brew update/install (#26159)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/26159
The snippets for working with Homebrew were duplicated across binary
builds, macOS builds, and iOS builds. In #25336, the CircleCI
configuration version was updated to version 2.1, which supports
parameterized commands. This means we no longer have to use YAML
tricks to duplicate stanzas and instead can natively define a series
of reusable steps.
Motivation for doing this is that the macOS binary builds were still
using the slow `brew update` instead of `git fetch` (see #25988).
[test macos]
[test wheel]
Test Plan: Imported from OSS
Differential Revision: D17366538
Pulled By: pietern
fbshipit-source-id: 194c0f37c1dc999705f3ba97fdabf4ff18728d93