If the warning light is coming on for more than a minute, it should be setting a trouble code in the body computer for the problem that is occuring at the time. You may want to have someone check the body computer for trouble codes next.
The compressor would run if the system looses air pressure or if a load is added to the truck.
Brake Switch or Shifter Solenoid ,are possibles
Have to look at wiring diagrams, to find how those
items work & what is most likely, to need adjusting
or replacing, if it fails a test