[pytorch][ci] run mobile code analysis on PR (#40247)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40247
This CI job was bypassed on PR because most part of it has already been
covered by mobile-custom-build-dynamic job that runs on every PR.
However, it can still fail independently because it builds and analyzes
a small test project, e.g.: if people forget to update the registration API
used in the test project.
So this PR changed it to only build and analyze the test project and run
the job on every PR.
Test Plan: Imported from OSS
Differential Revision: D22126044
Pulled By: ljk53
fbshipit-source-id: 6699a200208a65b249bd3a4e43ad72bc07388ce3