If you have access to Xanathar's Guide to EverythingXanathar's Guide to Everything, it offers the Eldritch Invocation 'Improved Pact Weapon':
You can use any weapon you summon with your Pact of the Blade feature as a spellcasting focus for your warlock spells.
In addition, the weapon gains a +1 bonus to its attack and damage rolls, unless it is a magic weapon that already has a bonus to those rolls.
Finally, the weapon you conjure can be a shortbow, longbow, light crossbow, or heavy crossbow.
That first line partly solves your problem - it makes your weapon your focus, which allows you to cast spells with a material component while holding a weapon and shield. (The rest of the invocation is just gravydoesn't impact on this particular question.) From From there, if you take War Caster you can cast all spells, or if you don't you can cast any that don't have a somatic component while lacking a material component.