Re-export the C API in Rust bindings #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coverage | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
# Check all PR | |
concurrency: | |
group: coverage-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
jobs: | |
coverage: | |
runs-on: ubuntu-22.04 | |
name: collect code coverage | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
# https://github.com/tox-dev/tox/issues/3238 | |
python -m pip install tox==4.14.0 | |
python -m pip install coverage | |
- name: cache tox environments | |
uses: actions/cache@v3 | |
with: | |
path: .tox | |
key: tox-${{ hashFiles('pyproject.toml', 'setup.cfg', 'tox.ini') }} | |
- name: Setup sccache | |
uses: mozilla-actions/[email protected] | |
with: | |
version: "v0.7.7" | |
- name: Setup sccache environnement variables | |
run: | | |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV | |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | |
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV | |
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV | |
- name: collect Python coverage | |
run: tox | |
env: | |
# Use the CPU only version of torch when building/running the code | |
PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | |
- name: combine coverage files | |
run: | | |
coverage combine .tox/*/.coverage | |
coverage xml | |
- name: upload to codecov.io | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
files: coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} |