From a1dc9456368fa21ba2782c34118adcb7b2f379a6 Mon Sep 17 00:00:00 2001 From: Ben Jeffery Date: Tue, 17 Oct 2023 16:48:29 +0100 Subject: [PATCH] Simplify testing --- .github/workflows/tests.yml | 58 +++++---------------- .mergify.yml | 24 ++++----- requirements/{CI-tests-conda.txt => ci.txt} | 0 3 files changed, 24 insertions(+), 58 deletions(-) rename requirements/{CI-tests-conda.txt => ci.txt} (100%) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 948a630..e192f07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,66 +23,32 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python: [ 3.7, 3.9 ] - os: [ macos-latest, ubuntu-latest, windows-latest ] - defaults: - run: - shell: bash + python: [ 3.8, 3.11 ] + # Reinstate windows-latest when msprime has wheels + os: [ macos-latest, ubuntu-latest] #, windows-latest ] steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.6.0 + uses: styfle/cancel-workflow-action@0.12.0 with: access_token: ${{ github.token }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true - - name: Cache conda and dependancies - id: cache - uses: actions/cache@v2 - with: - path: | - c:\Miniconda\envs\anaconda-client-env - /usr/share/miniconda/envs/anaconda-client-env - ~/osx-conda - ~/.profile - key: ${{ runner.os }}-${{ matrix.python}}-conda-v10-${{ hashFiles('requirements/CI-tests-conda.txt') }} - - - name: Install Conda - uses: conda-incubator/setup-miniconda@v2 - if: steps.cache.outputs.cache-hit != 'true' + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v4 with: - activate-environment: anaconda-client-env python-version: ${{ matrix.python }} - channels: conda-forge - channel-priority: strict - auto-update-conda: true - - - name: Fix windows .profile - if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' - run: | - cp ~/.bash_profile ~/.profile - - - name: Install conda deps - if: steps.cache.outputs.cache-hit != 'true' - shell: bash -l {0} #We need a login shell to get conda - run: conda install --yes --file=requirements/CI-tests-conda.txt - - - name: Fix OSX Cache Write #OSX Won't let the cache restore due to file perms - if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'macos-latest' - run: | - cp -r /usr/local/miniconda/envs/anaconda-client-env ~/osx-conda + cache: 'pip' - - name: Fix OSX Cache Restore - if: steps.cache.outputs.cache-hit == 'true' && matrix.os == 'macos-latest' + - name: Install dependencies run: | - mkdir -p /usr/local/miniconda/envs - sudo cp -r ~/osx-conda /usr/local/miniconda/envs/anaconda-client-env + which python + which python3 + python -m pip install -r requirements/ci.txt - name: Run tests run: | - source ~/.profile - conda activate anaconda-client-env python -m pytest -xv -n2 diff --git a/.mergify.yml b/.mergify.yml index 018c8fa..d02c7a8 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -4,12 +4,12 @@ queue_rules: - "#approved-reviews-by>=1" - "#changes-requested-reviews-by=0" - status-success=Lint - - status-success=Python (3.7, macos-latest) - - status-success=Python (3.9, macos-latest) - - status-success=Python (3.7, ubuntu-latest) - - status-success=Python (3.9, ubuntu-latest) - - status-success=Python (3.7, windows-latest) - - status-success=Python (3.9, windows-latest) + - status-success=Python (3.8, macos-latest) + - status-success=Python (3.11, macos-latest) + - status-success=Python (3.8, ubuntu-latest) + - status-success=Python (3.11, ubuntu-latest) + - status-success=Python (3.8, windows-latest) + - status-success=Python (3.11, windows-latest) - "status-success=ci/circleci: build" pull_request_rules: - name: Automatic rebase, CI and merge @@ -20,12 +20,12 @@ pull_request_rules: - base=main - label=AUTOMERGE-REQUESTED - status-success=Lint - - status-success=Python (3.7, macos-latest) - - status-success=Python (3.9, macos-latest) - - status-success=Python (3.7, ubuntu-latest) - - status-success=Python (3.9, ubuntu-latest) - - status-success=Python (3.7, windows-latest) - - status-success=Python (3.9, windows-latest) + - status-success=Python (3.8, macos-latest) + - status-success=Python (3.11, macos-latest) + - status-success=Python (3.8, ubuntu-latest) + - status-success=Python (3.11, ubuntu-latest) + - status-success=Python (3.8, windows-latest) + - status-success=Python (3.11, windows-latest) - "status-success=ci/circleci: build" actions: queue: diff --git a/requirements/CI-tests-conda.txt b/requirements/ci.txt similarity index 100% rename from requirements/CI-tests-conda.txt rename to requirements/ci.txt