Woman have always fought wars of course but normally informally. Female pirates, women fighting in drag, women fighting because their town was attacked and it was fight or die, etc. You do see occassional records of female fighters within the formal military (there's records of female samurai and ninjas, viking burials indicate female vikings, there's female military leaders in a bunch of cultures) but they tend to be exceptions among majority male military forces.
If you're looking for all female front line military units, there is only one pre 20th century example generally accepted as having happened. And that's the Dahomey Amazons in western Africa during most of the 19th century.
'Amazons of Black Sparta' by Stanley B. Alpern is a very good book about them, if you're interested.
The gender relations of dahomey are fascinating generally and worth looking into. Check out 'The Ewe-Speaking Peoples of the Slave Coast of West Africa' and some of the articles by Lorella Rouster for more on the general role of woman in west african kingdoms during the 19th century. It was mostly hugely regressive with sex slavery, human sacrifice, ritual servitude and submission of women to their husbands.
But Dahomey itself essentially created a new culture, government type and economy after the old fon style, of individual towns ran by their own headman under the loose moral rather than real leadership of a capital town, had collapsed due to the slave trade so it did a lot of things that nobody else did. (Again how successful they were at state building is well worth reading further into. I.A. Akinjogbin 'dahomey and it's neighbours' is the most positive view of the dahomion reforms I've seen with Karl Polanyi's 'Dahomey and the slave trade' being the most negative. Though both of those were written in the 1960s so might be well out of date.)
One of the things they did is bring woman into roles that they hadn't held previously. So because their king was an absolute ruler who ruled by power rather than moral leadership and because the state took direct control of the country in a way that hadn't previously happened in benin (including laws on what crops you could grow and when you could let farm animals run wild etc.) they needed a bureaucracy. And because the dahomey religion believed in duality, the way the bureaucracy worked was each male bureaucrat was assigned a 'mother', a female bureaucrat who would check his work and make sure he wasn't lying to the king about how much tax he was collecting for instance. Which set a precedent of the King relying increasingly on woman to keep the men in check as he could rely on their loyalty as they were outside of the traditional power structure. King Ghezo went a step further and relied mainly on foreign, non fon, women who he had taken by his slavers from nigerian and togoloese families so they'd be twice the outsider (he even gave one of these woman as a gift to queen Victoria where she became a british lady). Anyway women were part of the dahomian bureaucracy from the beginning which led to female palace guards and female elephant hunters. And because dahomey fought a lot of wars, they eventually needed more manpower then they could recruit and the inevitable result was female front line units. Which by the time of the late 19th century they had a decent amount of and again nobody else prior to that did.
How they managed to arm such a large amount of their woman and also maintain the ritual servitude and submission of women to their husbands is questionable but lots of other societies armed serfs and peasants. Richard Burton, a welsh diplomat who visited dahomey in the 1860s, argued it was because the amazons (the female soldiers) didn't consider themselves women but men, that they'd been given the male gender by their king and so were entitled to male privileges. That's debatable but we do know that they had their own female servants/slaves and sang a war song that went 'we are men, we are not women'. They were also banned from having any sexual relations with men let alone marrying them so whether or not they were actually viewed as men, they were certainly taken out of the usual role for women and treat as a separate case.
A.B. Ellis, who visited dahomey in 1895, claimed the dahomians themselves viewed women as superior to men so that was why there was no push back against the amazons (to some extent, you can trace this back to the religion and the belief in duality. The god mawu-Lisa was sometimes depicted as two siblings, a male lisa and a female mawu, but also sometimes as a dual spirited single entity with male and female parts, you can see how that might lead to a different view of women than a purely male creator god) but he also wrote about the hundreds of woman kept in servitude as wives to the king or the priests so if they did think that, they didn't live up to their ideals. The average non amazon woman doesn't seem to have been well treated at all, beyond anything else we have eye witness reports by the crew of the HMS Bonetta of the bloody execution of female slaves by men at the annual customs.
In terms of their effectiveness, the military of the dahomey kingdom were more effective than most of their African neighbours with the amazons participating in victories against the mahi, aja, oyo and badagry but suffered brutal defeats against European and American armies. Missionaries from the Southern Baptist Convention wiped out hundreds of the amazons at Abeokuta in 1851 for instance (according to the eye witness report of Thomas Jefferson Bowen). And the French made short work of them in 1890 and 1892. But you could say that for any African army of that time period.