Test/metatensor v0.2.0 #985
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: TorchScript tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| # Check all PR | |
| concurrency: | |
| group: torch-tests-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.os }} | |
| name: ${{ matrix.os }} / Python ${{ matrix.python-version }} / Torch ${{ matrix.torch-version }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| python-version: "3.10" | |
| torch-version: "2.3" | |
| numpy-version-pin: "<2.0" | |
| - os: ubuntu-24.04 | |
| python-version: "3.10" | |
| torch-version: "2.11" | |
| - os: ubuntu-24.04 | |
| # Keep a building with Python 3.13 since TorchScript is deprecated | |
| # in Python 3.14 | |
| python-version: "3.13" | |
| torch-version: "2.11" | |
| - os: ubuntu-24.04 | |
| python-version: "3.14" | |
| torch-version: "2.11" | |
| - os: macos-15 | |
| python-version: "3.14" | |
| torch-version: "2.11" | |
| - os: windows-2022 | |
| python-version: "3.14" | |
| torch-version: "2.11" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup sccache | |
| uses: mozilla-actions/sccache-action@v0.0.9 | |
| with: | |
| version: "v0.10.0" | |
| - name: setup MSVC command prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - 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: install tests 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: run tests | |
| run: tox -e lint,torch-tests,torch-tests-cxx,torch-install-tests-cxx,docs-tests | |
| env: | |
| PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu | |
| METATOMIC_TESTS_TORCH_VERSION: ${{ matrix.torch-version }} | |
| METATOMIC_TESTS_NUMPY_VERSION_PIN: ${{ matrix.numpy-version-pin }} | |
| - name: combine Python coverage files | |
| shell: bash | |
| run: | | |
| coverage combine .tox/*/.coverage | |
| coverage xml | |
| - name: upload to codecov.io | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| fail_ci_if_error: true | |
| files: coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} |