A man described in court testimony as the "godfather" of a New York union local involved in the investigation of Labor Secretary Raymond J. Donovan has lost his appeal of a criminal contempt conviction in an earlier case concerning the same union.

The U.S. Circuit Court of Appeals in New York rejected the contentions of Samuel (Big Sam) Cavalieri, identified in court records as a member of the Lucchese family of the Mafia.

Cavalieri's attorney, Joseph Panzer, said last night that he would carry the appeal to the U.S. Supreme Court.

Cavalieri, who was described in testimony as the real "boss" of Laborers Local 29 in New York, was found guilty last year of criminal contempt for refusing to testify before a federal grand jury investigating alleged corruption in the local.

Despite a court order directing him to respond under a grant of immunity, Cavalieri declined to say whether he had been aware of any illegal payoffs received by Local 29 President Louis Sanzo.

A federal judge last summer held that "Big Sam" Cavalieri was "heavily involved in organized crime" and sentenced him to 3 1/2 years for criminal contempt. He appealed on grounds that he had already been held in civil contempt and that he should have been warned that he might later be tried for criminal contempt as well.

The judges said in their Jan. 15 ruling that they had already rejected that argument in dealing with Local 29's secretary-treasurer, Amadeo Petito.

However, the ruling against Petito, who was appealing a four-year sentence for perjury and contempt in the Local 29 investigation, was not filed in the Court of Appeals until yesterday.

Petito's stiffer sentence came after he denied to a grand jury that he had attended a 1978 meeting at Cavalieri's social club in East Harlem after a Local 29 nominations meeting. The nominations meeting effectively spelled the end to self-styled union "reformer" Mario Montuoro's tenure as secretary-treasurer.

The current investigation involving the labor secretary was triggered by Montuoro's charge that Donovan was at a 1977 luncheon when an official of Donovan's company, Schiavone Construction, handed Sanzo an envelope containing $2,000 in cash.