From 55190da5272e3f70ff8dabf7c2692a336cfbc256 Mon Sep 17 00:00:00 2001 From: ZhuLvs Date: Mon, 21 Oct 2024 23:21:37 +0800 Subject: [PATCH] Update python-package-conda.yml --- .github/workflows/python-package-conda.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index 5c0121c..b84b3a9 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -19,27 +19,39 @@ jobs: - name: Add conda to system path run: | echo $CONDA/bin >> $GITHUB_PATH + + - name: Install Miniconda + uses: goanpeca/setup-miniconda@v2 + with: + auto-activate-base: false - name: Create conda environment run: | + conda init bash + source ~/.bashrc # This reloads the shell with conda initialized conda create -n 2DIR python=3.8 -y - conda activate 2DIR - - name: Install PyTorch and dependencies via conda + - name: Activate conda environment and install PyTorch run: | + source ~/.bashrc + conda activate 2DIR conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch -y - name: Install dependencies from requirements.txt run: | + source ~/.bashrc + conda activate 2DIR pip install -r ./install/requirements.txt - name: Lint with flake8 run: | + conda activate 2DIR conda install flake8 -y flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | + conda activate 2DIR conda install pytest -y pytest