diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 7657882a..84c04b77 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -3,7 +3,7 @@ name: tests -on: +on: push: branches: - main @@ -14,7 +14,7 @@ on: - main workflow_dispatch: -jobs: +jobs: test: name: ${{ matrix.platform }} py${{ matrix.python-version }} runs-on: ${{ matrix.platform }} @@ -26,10 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -45,21 +47,25 @@ jobs: deploy: # this will run when you have tagged a commit, starting with "v*" - # and requires that you have put your twine API key in your + # and requires that you have put your twine API key in your # github secrets (see readme for details) needs: [test] runs-on: ubuntu-latest if: contains(github.ref, 'tags') + steps: - uses: actions/checkout@v4 + - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.x" + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -U setuptools setuptools_scm wheel twine + - name: Build and publish env: TWINE_USERNAME: __token__ diff --git a/tox.ini b/tox.ini index b8d88d32..28f6ec9e 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ python = 3.10: py310 3.11: py311 fail_on_no_env = True - + [gh-actions:env] PLATFORM = ubuntu-latest: linux @@ -16,24 +16,32 @@ PLATFORM = windows-latest: windows [testenv] -platform = +platform = macos: darwin linux: linux windows: win32 -passenv = +passenv = CI GITHUB_ACTIONS DISPLAY,XAUTHORITY NUMPY_EXPERIMENTAL_ARRAY_FUNCTION PYVISTA_OFF_SCREEN + TEMP + TMP + TMPDIR + TORCHINDUCTOR_CACHE_DIR +setenv = + windows: TORCHINDUCTOR_CACHE_DIR = {env:TEMP}{/}torchinductor + macos: TORCHINDUCTOR_CACHE_DIR = {env:TMPDIR}{/}torchinductor + linux: TORCHINDUCTOR_CACHE_DIR = {env:TMPDIR:/tmp}{/}torchinductor extras = gui -deps = +deps = .[gui] py pytest pytest-cov pytest-xvfb # ignoring contrib tests for now -commands = +commands = #linux: apt-get update && apt-get install libgl1 pytest -vv -rA --color=yes --cov=cellpose --cov-report=xml --ignore=tests/contrib --durations=0