# This workflow runs pytest on the codebase in a matrix of platforms. # # It may be triggered via dispatch, or by another workflow. name: 'Check: pytest' on: workflow_dispatch: workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: matrix: strategy: matrix: python-version: - '3.10' pytorch: - linux-cuda-11_7 - linux-rocm-5_2 - linux-cpu - macos-default - windows-cpu include: - pytorch: linux-cuda-11_7 os: ubuntu-22.04 github-env: $GITHUB_ENV - pytorch: linux-rocm-5_2 os: ubuntu-22.04 extra-index-url: 'https://download.pytorch.org/whl/rocm5.2' github-env: $GITHUB_ENV - pytorch: linux-cpu os: ubuntu-22.04 extra-index-url: 'https://download.pytorch.org/whl/cpu' github-env: $GITHUB_ENV - pytorch: macos-default os: macOS-12 github-env: $GITHUB_ENV - pytorch: windows-cpu os: windows-2022 github-env: $env:GITHUB_ENV name: ${{ matrix.pytorch }} on ${{ matrix.python-version }} runs-on: ${{ matrix.os }} timeout-minutes: 30 # expected run time: <10 min, depending on platform env: PIP_USE_PEP517: '1' steps: - uses: actions/checkout@v4 - name: set test prompt to main branch validation run: echo "TEST_PROMPTS=tests/validate_pr_prompt.txt" >> ${{ matrix.github-env }} - name: setup python uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: pyproject.toml - name: install invokeai env: PIP_EXTRA_INDEX_URL: ${{ matrix.extra-index-url }} run: > pip3 install --editable=".[test]" - name: run pytest id: run-pytest run: pytest