In this paper, we proposed an all-optical version of photonic spiking neurons and spike-time-dependent plasticity (STDP) based on the nonlinear optical effects within a micro-ring resonator. In this system, the self-pulsing effect was exploited to implement threshold control, and the equivalent pulse energy required for spiking, calculated by multiplying the input pulse power amplitude with its duration, was about 14.1 pJ. The positive performance of the neurons in the excitability and cascadability tests validated the feasibility of this scheme. Furthermore, two simulations were performed to demonstrate that such an all-optical spiking neural network incorporated with STDP could run stably on a stochastic topology. The essence of such an all-optical spiking neural network is a nonlinear spiking dynamical system that combines the advantages of photonics and spiking neural networks (SNNs), promising access to the high speed and lower consumption inherent to optical systems.