簡體   English   中英

從 GitHub 操作中的 conda 環境運行時找不到 pytest

[英]pytest not found when running from a conda environment in GitHub Actions

我正在嘗試使用 GitHub Actions 測試我的包,其中該包在conda環境中運行。 在本地一切正常。 但是在 GitHub Actions 上,它說pytest: command not found with this workflow file

name: Build and Test [Python 3.6, 3.7]

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.6, 3.7]

    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          persist-credentials: false

      - name: Setup Miniconda using Python ${{ matrix.python-version }}
        uses: goanpeca/setup-miniconda@v1
        with:
          activate-environment: microdf
          environment-file: environment.yml
          python-version: ${{ matrix.python-version }}
          auto-activate-base: false

      - name: Build
        shell: bash -l {0}
        run: |
          pip install -e .
      - name: Run tests
        run: |
          pytest

我試圖消除pytestconda環境, 而不是運行pip install pytest運行前pytest ,但給了一個不同的錯誤: error: invalid command 'bdist_wheel'

您需要指定shell ,如Build步驟中所示:

- name: Run tests
  shell: bash -l {0}
  run: pytest

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM