The general concept is reporter's privilege, which is a protection against being compelled to testify about confidential information. There is no clear national statute or ruling in the US, but most states have enacted shield laws. Since these are state laws, they vary considerably. It had been thought that the First Amendment protected reporters from having to reveal sources, but in Branzburg v. Hayes, 408 U.S. 665, it was held that
The First Amendment does not relieve a newspaper reporter of the obligation that all citizens have to respond to a grand jury subpoena and answer questions relevant to a criminal investigation
That 1972 decision is the sum of what SCOTUS has to say about the topic. States then enacted various protections for reporters against compelled testimony.
There are specific law requiring certain individuals to report suspected crimes, whereby doctors and teachers have to report certain suspicions or facts when they encounter them in the course of their work. As a subcase of mandatory reporting, in 18 states, everyone is required to report child abuse (but not in California). There are no mandatory reporting requirements for reporters apart from the limited universal requirement pertaining to child abuse. There are widespread laws against aiding and abetting, so if a reporter drove the getaway car, they would be in trouble – almost certainly not applicable to typical cases of investigative journalism.
Some states have a law about failure to report a felony, so in Texas, it is a Class A misdemeanor to fail to report. However, the duty is somewhat narrowly limited to one who
observes the commission of a felony under circumstances in which a reasonable person would believe that an offense had been committed in which serious bodily injury or death may have resulted
Witnessing murder would be covered by this. Ohio has a stronger law, which creates a duty to report any felony. From what I can tell, California does not have such a law.
[ADDENDUM]
The Reporter's Committee for Freedom of the Press makes available a by-state compendium of legal sources, with case law for all sorts of situations.