To test compression remove the spark plug, place your finger over (NOT IN) the hole and pull the cord. If it has compression it will suck on your finger. No suck no compression. No compression change the head gasket as a start (if the rings and bore are good as you say). To test the decompression valve remove it, place a length of (NEW) fuel line on the outlet and suck on it. If it closes it's working.
People throw all sorts of things away like that. 3 weeks ago I bought 2 newish ryobi trimmers for $20 (total) from a guy here in Adelaide. Not working, etc etc. I got them home, put fresh fuel in them and sold them both 2 days later for $80 each. Not a bad profit!