Schwinger-Keldysh formalism II: Thermal equivariant cohomology