Here is a giant Pumpkin and Melon farm. You will never run out of these ingredients!
Working from 1.13 to newest version.
This structure can cause issues on servers/low PCs due to a big amount of pistons and observer.
A light version of this farm is available here : https://www.minecraft-schematics.com/schematic/18939/
Pumpkin : ~325/minutes
Melon Slice : ~1025/minutes