From 9f238203cc03a90b0ef50d5cdd3d6bed8d936afa Mon Sep 17 00:00:00 2001 From: bxdd Date: Wed, 1 Nov 2023 15:37:38 +0800 Subject: [PATCH] [FIX] fix CI --- .github/workflows/install_learnware_with_pip.yaml | 11 +++++------ .../workflows/install_learnware_with_source.yaml | 13 ++++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/install_learnware_with_pip.yaml b/.github/workflows/install_learnware_with_pip.yaml index 4b4f86a..2430bb1 100644 --- a/.github/workflows/install_learnware_with_pip.yaml +++ b/.github/workflows/install_learnware_with_pip.yaml @@ -33,22 +33,21 @@ jobs: - name: Create conda env for macos run: | conda create -n learnware python=${{ matrix.python-version }} - conda activate learnware - name: Update pip to the latest version run: | - python -m pip install --upgrade pip - python -m pip install pytest + conda run -n learnware python -m pip install --upgrade pip + conda run -n learnware python -m pip install pytest - name: Install faiss for MacOS if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-latest' }} run: | - conda install -c pytorch faiss + conda run -n learnware conda install -c pytorch faiss - name: Install learnware run: | - python -m pip install learnware + conda run -n learnware python -m pip install learnware - name: Test workflow run: | - pytest tests/test_workflow/test_workflow.py \ No newline at end of file + conda run -n learnware python -m pytest tests/test_workflow/test_workflow.py \ No newline at end of file diff --git a/.github/workflows/install_learnware_with_source.yaml b/.github/workflows/install_learnware_with_source.yaml index d0fb6af..0a0e49b 100644 --- a/.github/workflows/install_learnware_with_source.yaml +++ b/.github/workflows/install_learnware_with_source.yaml @@ -33,27 +33,26 @@ jobs: - name: Create conda env for macos run: | conda create -n learnware python=${{ matrix.python-version }} - conda activate learnware - name: Update pip to the latest version run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest + conda run -n learnware python -m pip install --upgrade pip + conda run -n learnware python -m pip install flake8 pytest - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + conda run -n learnware python -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - name: Install faiss for MacOS if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-latest' }} run: | - conda install -c pytorch faiss + conda run -n learnware conda install -c pytorch faiss - name: Install learnware run: | - python -m pip install . + conda run -n learnware python -m pip install . - name: Test workflow run: | - pytest tests/test_workflow/test_workflow.py \ No newline at end of file + conda run -n learnware python -m pytest tests/test_workflow/test_workflow.py \ No newline at end of file