Energy, work, and power

An ideal spring is compressed from its relaxed length. The spring force points opposite the compression displacement of the end being pushed. What is the work done by the spring force during the compression?