Add rust coverage data to coverage CI collection (#8365)
Add rust coverage data to coverage CI collection (#8365)

* Add rust coverage data to coverage CI collection

This commit expands the existing coverage data collection for the github
actions coverage job to also include rust source coverage. To accomplish
this we need to build the qiskit-terra compiled extension with the rust
`instrument-coverage` compiler flag to instrument the binary. Then we use
grcov to generate an lcov file from the collected coverage data and
finally we combine the lcov files from rust and python into a single
file and upload that to coveralls. Ideally this will enable us to ensure
our python unittests provide sufficient coverage of compiled code in
Qiskit and highlight any potential gaps in test coverage.

* Add necessary rust llvm toolchain pieces

* Stop using tox and build terra by hand

Tox wasn't enabling passing the passenv variables from the environment
to pip during the build step. This prevented the instrumented binary
from being built which caused the grcov step to fail. To address this,
this commit stops using tox so we can manually build terra from source
and set the appropriate flags on rustc/cargo to enabled the coverage
instrumentation.

* Use pip to pull in pyproject.toml build deps

* Fix typo

* Remove unused mv line

* Fix typo

* Generate separate rust coverage files for different test stages

* Clear coverage data between test steps

* Remove stray target entry in rust coverage data

* Try extra grcov options

* Update .github/workflows/coverage.yml

* Drop rust flags from tox.ini

Co-authored-by: mergify[bot] <b09a6ee808b67e98a221404e7aaa52e0398a4954@users.noreply.github.com>
QISKit/qiskit-sdk-py,QISKit/qiskit-sdk-py,QISKit/qiskit-sdk-py