I've finished the campaign on normal and hard and have always been one upgrade short of having them all. I can't find a breakdown of how each upgrade is earned in-game but here is what I've found:
1 upgrade per level: (15)
1 upgrade for Evacuation (Cardinal)
1 upgrade for Spirit Gate
1 upgrade for Tyranid faction defeat
1 upgrade for Eldar faction end (thinks this is regardless of choice)
Grand total: 19 in total
My question is if there is anything I'm missing? I did all the side missions and hit the level cap. Or is there only 19?