rel: try to test v0.2.0 #1197
Workflow file for this run
This file contains hidden or 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: [main] | |
| pull_request: | |
| # Check all PR | |
| concurrency: | |
| group: coverage-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-24.04 | |
| name: collect code coverage | |
| steps: | |
| - name: free disk space | |
| run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android || true | |
| - uses: actions/checkout@v4 | |
| - name: setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: setup rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: install cargo tarpaulin | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-tarpaulin | |
| - name: install python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install tox coverage | |
| - name: install metatensor from labels-values-array-clean branch | |
| run: | | |
| pip install setuptools cmake packaging wheel | |
| git clone --depth 1 --branch labels-values-array-clean https://github.com/HaoZeke/metatensor.git ${{ runner.temp }}/metatensor-v020 | |
| METATENSOR_NO_LOCAL_DEPS=1 pip install --no-build-isolation ${{ runner.temp }}/metatensor-v020/python/metatensor_core | |
| METATENSOR_NO_LOCAL_DEPS=1 pip install --no-build-isolation ${{ runner.temp }}/metatensor-v020/python/metatensor_operations | |
| METATENSOR_NO_LOCAL_DEPS=1 pip install --no-build-isolation ${{ runner.temp }}/metatensor-v020/python/metatensor_learn | |
| pip install torch | |
| METATENSOR_NO_LOCAL_DEPS=1 pip install --no-build-isolation ${{ runner.temp }}/metatensor-v020/python/metatensor_torch | |
| env: | |
| PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | |
| - name: install lcov | |
| run: sudo apt install -y lcov | |
| - name: Setup sccache | |
| uses: mozilla-actions/sccache-action@v0.0.9 | |
| with: | |
| version: "v0.10.0" | |
| - 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 rust and C/C++ coverage | |
| run: | | |
| cargo tarpaulin --all-features --workspace --engine=llvm --out=xml --output-dir=target/tarpaulin --objects target/debug/libfeatomic.so | |
| # cleanup C/C++ coverage | |
| lcov --directory . --capture --output-file coverage.info | |
| lcov --remove coverage.info '/usr/*' "$(pwd)/featomic/tests/*" "$(pwd)/featomic/examples/*" --output-file coverage.info | |
| - name: collect Python coverage | |
| run: | | |
| tox -e all-deps | |
| tox -e torch-tests | |
| 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 Python coverage files | |
| run: | | |
| coverage combine --append ./python/featomic/.coverage ./python/featomic_torch/.coverage | |
| coverage xml | |
| - name: upload to codecov.io | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: true | |
| files: target/tarpaulin/cobertura.xml,coverage.xml,coverage.info |