This requires to capture the peak voltage - another extension of the interface. The Arduino CapSense library uses the opposite way, injects a current until a certain voltage level (threshold) is reached.
SPI typically works at controller clock, no chance to measure a real rise time smaller than a clock pulse.
I2C rise time depends on the pullup resistors on the wires. Meaningful measurement is possible only in the field, with all modules installed and wired up. Or you have to install an equivalent pullup resistor on a properly sized cable.