name: Test leanrnware from source code on: push: branches: [ main ] pull_request: branches: [ main ] jobs: build: timeout-minutes: 120 runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-20.04] python-version: [3.8, 3.9] steps: - name: Test learnware from pip uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Add conda to system path run: | # $CONDA is an environment variable pointing to the root of the miniconda directory echo $CONDA/bin >> $GITHUB_PATH - 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 - 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 - name: Install faiss for MacOS if: ${{ matrix.os == 'macos-11' || matrix.os == 'macos-latest' }} run: | conda install -c pytorch faiss - name: Install learnware run: | python -m pip install . - name: Test workflow run: | pytest tests/test_workflow/test_workflow.py