In short, for past missions NASA has said no, it was not a priority consideration.
In the future, this may change and it is being considered.
In EXPLORING MARS WITH SOLAR-POWERED ROVERS
.. there has been some interest in developing means to mitigate the effect of dust on the solar arrays for long-duration operation on Mars.. however, the engineering decision was that it would be more cost effective to oversize the arrays to account for the predicted degradation than it would be to fly a system to remove dust from the panels.
Since the operating temperature varies significantly during the day, and the spectrum of the incident sunlight varies both with time of day and with the amount of dust in the atmosphere, the performance of the solar arrays on Mars is complicated.
https://ntrs.nasa.gov/api/citations/20060013412/downloads/20060013412.pdf
With the latest Mars-bound rover (explored more below) in its current configuration, they calculated that it would be acceptable to have more than 30% loss in power output by the time the rover reached its end of life due to dust coverage, rather than try and design some kind of dust removal mechanism.
In 2017, NASA did include this provision with the request for concepts in the period 2018-2020:
Mars Surface Solar Array Structures
NASA Space Tech “seedling” study to
develop a Mars power architecture with
deployable solar arrays
Note requirement number 14: Ability to tilt arrays for dust removal and to feather in high winds.
Unfortunately, no concepts were delivered that satisfied this requirement.
https://ntrs.nasa.gov/api/citations/20170004910/downloads/20170004910.pdf
With regards to ExoMars, a rover bound for Mars (or Moon, as suggested in light of the withdrawal of Russian involvement recently): It was looked at originally, and then in its current configuration they decided that no - it was too risky, and too costly.
With the rebirth of the ExoMars mission (not launching before 2028) - they are looking at it again, and then...so this changes to a maybe.
(Note: aka Rosalind Franklin Rover, so @uhoh's question is also here Will the Rosalind Franklin (ExoMars) rover solar panels be able to clear themselves of dust by tilting?)
TL;DR: