When spinning particles, such as electrons and photons, undergo spin-orbit coupling, they can acquire an extra phase in addition to the well-known dynamical phase. This extra phase is called the geometric phase (also known as the Berry phase), which plays an important role in a startling variety of physical contexts such as in photonics, condensed matter, high-energy and space physics. The geometric phase was originally discussed for a cyclically evolving physical system with an Abelian evolution, and was later generalized to non-cyclic and non-Abelian cases, which are the most interesting fundamental subjects in this area and indicate promising applications in various fields. Here, we enable optical spin-orbit coupling in asymmetric microcavities and experimentally observe a non-cyclic optical geometric phase acquired in a non-Abelian evolution. Our work is relevant to fundamental studies and implies promising applications by manipulating photons in on-chip quantum devices.