From 208747bcafe28dd6ca58c1f80b81783c9ee38f7e Mon Sep 17 00:00:00 2001 From: Maarten de Vries Date: Mon, 31 Jul 2023 13:45:10 +0200 Subject: [PATCH] Install pytorch on github CI. --- .github/workflows/rust.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b28b9b9..3439ffc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,6 +8,15 @@ jobs: name: Build and test runs-on: ubuntu-latest steps: + - name: Install pytorch + run: | + pip3 install torch==2.0.0 torchvision==0.15.0 --index-url https://download.pytorch.org/whl/cpu + echo LIBTORCH_USE_PYTORCH=1 >> "$GITHUB_ENV" + echo "$LD_LIBRARY_PATH" + echo LD_LIBRARY_PATH="$(python -m site --user-site)/torch/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV" + echo "LALALA=" + cat "$GITHUB_ENV" + - name: Checkout code uses: actions/checkout@master @@ -22,18 +31,24 @@ jobs: - name: Build uses: actions-rs/cargo@v1 + env: + LIBTORCH_USE_PYTORCH: 1 with: command: build args: --release --features full --color=always - name: Clippy uses: actions-rs/clippy-check@v1 + env: + LIBTORCH_USE_PYTORCH: 1 with: token: ${{ secrets.GITHUB_TOKEN }} args: --release --features full - name: Test uses: actions-rs/cargo@v1 + env: + LIBTORCH_USE_PYTORCH: 1 with: command: test args: --release --features full --color=always