From cf9bc17fc3663430419c1471da4043f016e6a3dc Mon Sep 17 00:00:00 2001 From: Luis Pedro Coelho Date: Thu, 14 Oct 2021 12:48:56 +0200 Subject: [PATCH] TST Fix testing & update version matrix - Use the right version of Python in the conda environment - Include newer Python & NumPy versions - Use right shell for tests --- .github/workflows/python-package-conda.yml | 33 ------------ .../test-python-package-with-conda.yml | 50 +++++++++++++++++++ 2 files changed, 50 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/python-package-conda.yml create mode 100644 .github/workflows/test-python-package-with-conda.yml diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml deleted file mode 100644 index d87206e7..00000000 --- a/.github/workflows/python-package-conda.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Test mahotas - -on: [push] - -jobs: - build-linux: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.5', '3.6', '3.7', '3.8'] - numpy-version: ['1.16', '1.17', '1.18', '1.19'] - max-parallel: 5 - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - 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: Install dependencies - run: | - conda install --name base numpy=${{ matrix.numpy-version }} - conda install --file tests-requirements.txt --name base - - name: Build - run: | - make debug - - name: Test with pytest - run: | - pytest -v diff --git a/.github/workflows/test-python-package-with-conda.yml b/.github/workflows/test-python-package-with-conda.yml new file mode 100644 index 00000000..d503828b --- /dev/null +++ b/.github/workflows/test-python-package-with-conda.yml @@ -0,0 +1,50 @@ +name: Test mahotas + +on: [push] + +jobs: + build-linux: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9'] + numpy-version: ['1.17', '1.18', '1.19', '1.20', '1.21'] + exclude: + # 3.6 is too old for NumPy 1.20/1.21 + - python-version: '3.6' + numpy-version: '1.20' + - python-version: '3.6' + numpy-version: '1.21' + + # NumPy 1.17/1.18 are too old for Python 3.9 + - python-version: '3.9' + numpy-version: '1.17' + - python-version: '3.9' + numpy-version: '1.18' + max-parallel: 5 + + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: mahotas_test_env + python-version: ${{ matrix.python-version }} + auto-activate-base: false + - 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: Install dependencies + run: | + conda install --name mahotas_test_env python=${{ matrix.python-version }} numpy=${{ matrix.numpy-version }} + conda install --file tests-requirements.txt --name mahotas_test_env + - name: Build + shell: bash -l {0} + run: | + conda activate mahotas_test_env + make debug + - name: Test with pytest + shell: bash -l {0} + run: | + conda activate mahotas_test_env + python -m pytest -v